{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Managing offline map areas"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Introduction"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "With ArcGIS you can take your web maps and layers offline to reliably work with your GIS data in disconnected scenarios when connectivity is intermittent or unavailable. \n",
    "\n",
    "To learn about the concepts, steps, data requirements and applications that support taking a map offline, refer to the appropriate documentation pages:\n",
    "\n",
    "* [ArcGIS Online](https://doc.arcgis.com/en/arcgis-online/manage-data/take-maps-offline.htm)\n",
    "* [ArcGIS Enterprise](https://enterprise.arcgis.com/en/portal/latest/use/take-maps-offline.htm)\n",
    " \n",
    "\n",
    "Once web maps have been prepared, certain applications in the ArcGIS Platform and the [ArcGIS Runtime SDKs](https://developers.arcgis.com/features/offline/) allow you to build applications that can utitlize these maps while remaining disconnected. These workflows all make use of [_offline map areas_](https://doc.arcgis.com/en/arcgis-online/manage-data/take-maps-offline.htm#ESRI_SECTION1_AB810E1B98EA4F248C3A7F22CB20DDFB), which a [web map](https://doc.arcgis.com/en/arcgis-online/reference/what-is-web-map.htm) owner can define in one of two ways:\n",
    "\n",
    "* ahead of the time field workers will download these areas for offline use, known as _preplanned map areas_\n",
    "* at the time field workers actually need to download them for use, known as _on-demand map areas_\n",
    "\n",
    "> **Note:** Only a web map owner can create offline map areas. See [Create and manage offline areas](https://enterprise.arcgis.com/en/portal/latest/use/take-maps-offline.htm#ESRI_SECTION1_8C6055E984D34AF4A25B989DDCAACF87) for details.\n",
    "\n",
    "Making map areas ahead of time is the *recommended* workflow because the map author can ensure accuracy of the offline content and packaging of offline contents occurs only once. Packaged content can be used by mutliple workers to increase performance. This guide describes how to use the ArcGIS API for Python to create **preplanned offline map areas** for use in custom ArcGIS Runtime SDK apps or Esri applications such as [ArcGIS Field Maps](https://doc.arcgis.com/en/field-maps/android/help/configure-the-map.htm#ESRI_SECTION1_1822CD8DD1E74F08BC4308E03A5677F1).\n",
    "\n",
    "Let's get started with the API to demonstrate preparing areas ahead of time."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "toc": true
   },
   "source": [
    "<h1>Table of Contents<span class=\"tocSkip\"></span></h1>\n",
    "<div class=\"toc\"><ul class=\"toc-item\"><li><span><a href=\"#Managing-offline-map-areas\" data-toc-modified-id=\"Managing-offline-map-areas-1\"><span class=\"toc-item-num\">1&nbsp;&nbsp;</span>Managing offline map areas</a></span><ul class=\"toc-item\"><li><span><a href=\"#Creating-offline-map-areas\" data-toc-modified-id=\"Creating-offline-map-areas-1.1\"><span class=\"toc-item-num\">1.1&nbsp;&nbsp;</span>Creating offline map areas</a></span><ul class=\"toc-item\"><li><span><a href=\"#Inspecting-offline-packages-created-for-a-map-area\" data-toc-modified-id=\"Inspecting-offline-packages-created-for-a-map-area-1.1.1\"><span class=\"toc-item-num\">1.1.1&nbsp;&nbsp;</span>Inspecting offline packages created for a map area</a></span></li></ul></li><li><span><a href=\"#Listing-offline-areas-created-for-a-web-map\" data-toc-modified-id=\"Listing-offline-areas-created-for-a-web-map-1.2\"><span class=\"toc-item-num\">1.2&nbsp;&nbsp;</span>Listing offline areas created for a web map</a></span></li><li><span><a href=\"#Updating-offline-areas\" data-toc-modified-id=\"Updating-offline-areas-1.3\"><span class=\"toc-item-num\">1.3&nbsp;&nbsp;</span>Updating offline areas</a></span></li></ul></li></ul></div>"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Creating offline map areas\n",
    "\n",
    "With ArcGIS API for Python, you can conveniently manage offline areas from a _`Map`_ object. The [`offline_areas`](/python/api-reference/arcgis.map.toc.html#arcgis.map.Map.offline_areas) property accesses the [`OfflineMapAreaManager`](/python/api-reference/arcgis.map.toc.html#offlinemapareamanager) object with which you can administer all aspects of offline map area management, from creating, to listing to updating. Let's take a look:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 118,
   "metadata": {},
   "outputs": [],
   "source": [
    "from arcgis.gis import GIS\n",
    "from arcgis.map import Map"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "gis = GIS(profile=\"your_online_api_data_owner_profile\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Let's use a hydrology _web map_ depicting the Middle Little Missouri River Sub Basin from the [National Hydrology Dataset](https://www.usgs.gov/national-hydrography/national-hydrography-dataset) in the state of North Dakota in the United Sates."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div class=\"item_container\" style=\"height: auto; overflow: hidden; border: 1px solid #cfcfcf; border-radius: 2px; background: #f6fafa; line-height: 1.21429em; padding: 10px;\">\n",
       "                    <div class=\"item_left\" style=\"width: 210px; float: left;\">\n",
       "                       <a href='https://geosaurus.maps.arcgis.com/home/item.html?id=6d7330a7f3f5438ebcbc6fe23f8abcc8' target='_blank'>\n",
       "                        <img src='' width='200' height='133' class=\"itemThumbnail\">\n",
       "                       </a>\n",
       "                    </div>\n",
       "\n",
       "                    <div class=\"item_right\"     style=\"float: none; width: auto; overflow: hidden;\">\n",
       "                        <a href='https://geosaurus.maps.arcgis.com/home/item.html?id=6d7330a7f3f5438ebcbc6fe23f8abcc8' target='_blank'><b>Middle Little Missouri Sub Basin Wetlands and Riparian Areas</b>\n",
       "                        </a>\n",
       "                        <br/>Map of the National Wetlands Inventory wetlands and riparian areas data for the Middle Little Missouri Sub-Basin.<br/><img src='https://geosaurus.maps.arcgis.com/home/js/jsapi/esri/css/images/item_type_icons/maps16.png' style=\"vertical-align:middle;\" width=16 height=16>Web Map by api_data_owner\n",
       "                        <br/>Last Modified: August 19, 2024\n",
       "                        <br/>0 comments, 753 views\n",
       "                    </div>\n",
       "                </div>\n",
       "                "
      ],
      "text/plain": [
       "<Item title:\"Middle Little Missouri Sub Basin Wetlands and Riparian Areas\" type:Web Map owner:api_data_owner>"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "wm_item = gis.content.get(\"6d7330a7f3f5438ebcbc6fe23f8abcc8\")\n",
    "wm_item"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "wm_obj = Map(item=wm_item)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "You can create offline areas for a specified extent, a specific polygon, or a bookmark. You can additionally specify any layers that you need to ignore, a destination folder to store these packages and a minimum and maximum scale to which the packages need to be cached. Let's examine a couple examples:"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Examining the Basemap for a Web map"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "When creating offline map areas, we need information about the basemap in order to package it correctly for offline use.  Whether a Basemap is a Tile layer or Vector Tile layer may alter how you have to construct the argument for the `tile_services` parameter.  We'll show an example of packaging for a Basemap configured from a Vector Tile Layer using 3 styles based upon the same service."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Let's use the `basemap` property of a Map to initialize a BasemapManger, then use the manager's `basemap` property to return information about the basemap:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'baseMapLayers': [{'id': 'VectorTile_8900',\n",
       "   'itemId': '2afe5b807fa74006be6363fd243ffb30',\n",
       "   'layerType': 'VectorTileLayer',\n",
       "   'opacity': 1.0,\n",
       "   'styleUrl': 'https://www.arcgis.com/sharing/rest/content/items/2afe5b807fa74006be6363fd243ffb30/resources/styles/root.json',\n",
       "   'title': 'Human Geography Base',\n",
       "   'visibility': True},\n",
       "  {'id': 'VectorTile_9702',\n",
       "   'isReference': True,\n",
       "   'itemId': '97fa1365da1e43eabb90d0364326bc2d',\n",
       "   'layerType': 'VectorTileLayer',\n",
       "   'opacity': 0.37,\n",
       "   'styleUrl': 'https://www.arcgis.com/sharing/rest/content/items/97fa1365da1e43eabb90d0364326bc2d/resources/styles/root.json',\n",
       "   'title': 'Human Geography Detail',\n",
       "   'visibility': True},\n",
       "  {'id': 'VectorTile_7804',\n",
       "   'isReference': True,\n",
       "   'itemId': 'ba52238d338745b1a355407ec9df6768',\n",
       "   'layerType': 'VectorTileLayer',\n",
       "   'opacity': 1.0,\n",
       "   'styleUrl': 'https://www.arcgis.com/sharing/rest/content/items/ba52238d338745b1a355407ec9df6768/resources/styles/root.json',\n",
       "   'title': 'Human Geography Label',\n",
       "   'visibility': True}],\n",
       " 'title': 'Human Geography Map'}"
      ]
     },
     "execution_count": 40,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "wm_obj.basemap.basemap"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We now have a dictionary representation of our `Human Geograpy Map` basemap. We can see it's comprised of 3 `VectorTileLayers` using 3 different styles to create the map. Let's get the layer item for each basemap layer:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 97,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[<Item title:\"Human Geography Base\" type:Vector Tile Layer owner:esri_vector>,\n",
       " <Item title:\"Human Geography Detail\" type:Vector Tile Layer owner:esri_vector>,\n",
       " <Item title:\"Human Geography Label\" type:Vector Tile Layer owner:esri_vector>]"
      ]
     },
     "execution_count": 97,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "basemap_lyr_items = [\n",
    "    gis.content.get(vlyr_id[\"itemId\"]) \n",
    "    for vlyr_id \n",
    "    in wm_obj.basemap.basemap[\"baseMapLayers\"]\n",
    "]\n",
    "basemap_lyr_items"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We'll use the _url_ for each of these layers to minimize the size of the vector tile package created for the offline map area."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 104,
   "metadata": {},
   "outputs": [],
   "source": [
    "base_url = basemap_lyr_items[0].url\n",
    "detail_url = basemap_lyr_items[1].url\n",
    "label_url = basemap_lyr_items[2].url"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Creating offline areas with _Bookmarks_\n",
    "The _web map_ depicts wetlands data from subwatersheds within the Little Missouri River basin area of North Dakota. We've created [`bookmarks`](/python/api-reference/arcgis.map.toc.html#bookmark) in the _web map_ for areas surrounding three subwatersheds:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 99,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Lower Garner Creek\n",
      "Merrifield Creek\n",
      "Bear Creek\n"
     ]
    }
   ],
   "source": [
    "for bookmark in wm_obj.bookmarks.list:\n",
    "    print(bookmark.name)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We'll create an offline area for the bookmark called _Lower Garner Creek_. We'll also limit the data extracted into the offline map area package to specific layers in the web map. We'll include a subwatershed boundaries layer and a wetlands layer designating features we want our field workers to update. Let's first look at the list of layers from our web map so we know how to create a list of layers for the `ignore_layers` argument."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 100,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "6  Middle_Little_Missouri_Subbasin\n",
      "  https://services7.arcgis.com/YoUrOrgANIzATIon/arcgis/rest/services/Middle_Little_Missouri_SubBasin_Wetlands_and_Riparian_Areas/FeatureServer/6\n",
      "5  Sub_Watershed Boundaries\n",
      "  https://services7.arcgis.com/YoUrOrgANIzATIon/arcgis/rest/services/Middle_Little_Missouri_SubBasin_Wetlands_and_Riparian_Areas/FeatureServer/5\n",
      "4  Theodore_Roosevelt_National_Park\n",
      "  https://services7.arcgis.com/YoUrOrgANIzATIon/arcgis/rest/services/Middle_Little_Missouri_SubBasin_Wetlands_and_Riparian_Areas/FeatureServer/4\n",
      "3  Middle Little Missouri Riparian Areas\n",
      "  https://services7.arcgis.com/YoUrOrgANIzATIon/arcgis/rest/services/Middle_Little_Missouri_SubBasin_Wetlands_and_Riparian_Areas/FeatureServer/3\n",
      "2  Middle Little Missouri Wetlands\n",
      "  https://services7.arcgis.com/YoUrOrgANIzATIon/arcgis/rest/services/Middle_Little_Missouri_SubBasin_Wetlands_and_Riparian_Areas/FeatureServer/2\n",
      "1  Populated_GNIS_Place_Names\n",
      "  https://services7.arcgis.com/YoUrOrgANIzATIon/arcgis/rest/services/Middle_Little_Missouri_SubBasin_Wetlands_and_Riparian_Areas/FeatureServer/1\n",
      "0  Non_Populated_GNIS_Places\n",
      "  https://services7.arcgis.com/YoUrOrgANIzATIon/arcgis/rest/services/Middle_Little_Missouri_SubBasin_Wetlands_and_Riparian_Areas/FeatureServer/0\n"
     ]
    }
   ],
   "source": [
    "for flyr in wm_obj.content.layers:\n",
    "    print(f\"{flyr.properties.id:<3}{flyr.properties.name}\\n{' '*2}{flyr.url}\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We only want to include layer 2, and layer 5. So let's use a list comprehension to create a list of the urls for the feature layers we want to ignore:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 101,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['https://services7.arcgis.com/YoUrOrgANIzATIon/arcgis/rest/services/Middle_Little_Missouri_SubBasin_Wetlands_and_Riparian_Areas/FeatureServer/6',\n",
       " 'https://services7.arcgis.com/YoUrOrgANIzATIon/arcgis/rest/services/Middle_Little_Missouri_SubBasin_Wetlands_and_Riparian_Areas/FeatureServer/4',\n",
       " 'https://services7.arcgis.com/YoUrOrgANIzATIon/arcgis/rest/services/Middle_Little_Missouri_SubBasin_Wetlands_and_Riparian_Areas/FeatureServer/3',\n",
       " 'https://services7.arcgis.com/YoUrOrgANIzATIon/arcgis/rest/services/Middle_Little_Missouri_SubBasin_Wetlands_and_Riparian_Areas/FeatureServer/1',\n",
       " 'https://services7.arcgis.com/YoUrOrgANIzATIon/arcgis/rest/services/Middle_Little_Missouri_SubBasin_Wetlands_and_Riparian_Areas/FeatureServer/0']"
      ]
     },
     "execution_count": 101,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "flyrs_to_ignore = [fl.url for fl in wm_obj.content.layers if not fl.url[-1] in [\"2\", \"5\"]]\n",
    "flyrs_to_ignore"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We'll also set the farthest scale users will zoom out to view layers in the package with the `min_scale` argument. In addition, we'll use the `item_properties` parameter to specify properties for the resulting _Map Area item_. We'll specify the _title_, _description_, and _tags_ for the _item_ that gets created. "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true,
    "jupyter": {
     "outputs_hidden": true
    }
   },
   "source": [
    "This operation can take a while as the server is packaging the contents of the web map for offline use. To view the status, you can optionally turn on the verbosity using the `env` module as shown below:\n",
    "\n",
    "```python\n",
    "from arcgis import env\n",
    "env.verbose = True\n",
    "```\n",
    "\n",
    "> **Note:** You must own the _web map_ to run this operation."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 108,
   "metadata": {},
   "outputs": [],
   "source": [
    "offline_item_properties = {\"title\": \"Offline area for Lower Garner Creek Subwatershed\",\n",
    "                          \"tags\": [\"Python\", \"automation\", \"hydrology\", \"wetlands\"],\n",
    "                          \"snippet\": \"Area created for updating wetlands and riparian areas.\"}\n",
    "\n",
    "lower_garner_offline_item = wm_obj.offline_areas.create(area = wm_obj.bookmarks.list[0].name,\n",
    "                                                        item_properties = offline_item_properties,\n",
    "                                                        min_scale = 126720,\n",
    "                                                        max_scale = 0,\n",
    "                                                        ignore_layers=flyrs_to_ignore,\n",
    "                                                        folder=\"Wetlands_Inventory\",\n",
    "                                                        tile_services=[\n",
    "                                                            {\n",
    "                                                                \"url\":base_url,\n",
    "                                                                \"levels\":\"9,10,11,12,13\"\n",
    "                                                            },\n",
    "                                                            {\n",
    "                                                                \"url\":detail_url,\n",
    "                                                                \"levels\":\"9,10,11,12,13\"\n",
    "                                                            },\n",
    "                                                            {\n",
    "                                                                \"url\":label_url,\n",
    "                                                                \"levels\":\"9,10,11,12,13\"\n",
    "                                                            }\n",
    "                                                        ])"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We can now use the [`list()`](/python/api-reference/arcgis.map.toc.html#arcgis.map.OfflineMapAreaManager.list) method on the _offline_areas_ object to examine the resulting [item](/python/api-reference/arcgis.gis.toc.html#arcgis.gis.Item):"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 109,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[<Item title:\"Offline area for Lower Garner Creek Subwatershed\" type:Map Area owner:api_data_owner>]"
      ]
     },
     "execution_count": 109,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "wm_obj.offline_areas.list()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Notice the _type_ attribute of the item is _Map Area_."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Create offline areas with an _Extent_"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We can also use an _extent_ object to create an offline map area. An extent defines a bounding box by specifying coordinate pairs for both the lower-left and upper-right corners. You can define an _extent_ yourself with coordinates that lie within the entire extent of the web map, or use existing features within web map layers to define an extent.\n",
    "\n",
    "We can define a smaller area within the bounds of our data using latitude and longitude coordinates for an area we know is within our overall extent. For this dataset, we know we are in southwestern North Dakota, so we'll define an extent covering a subarea of a subwatershed named Middlefield Creek within the basin.\n",
    "\n",
    "When using an _extent_ for the `area` argument we can use a dictionary formatted as below:\n",
    "\n",
    "extent_coordinates = {\n",
    "    \"xmin\": value,\n",
    "    \"ymin\": value,\n",
    "    \"xmax\": value,\n",
    "    \"ymax\": value,\n",
    "    \"spatialReference\": {\n",
    "         {\"wkid\": value}\n",
    "    }\n",
    "}\n",
    "\n",
    "> **Note:** The spatial reference of the extent object must match that of the Web map."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 110,
   "metadata": {},
   "outputs": [],
   "source": [
    "mfield_sub_extent = {\n",
    "    \"xmin\": -11528805.585,\n",
    "    \"ymin\": 5907789.4016,\n",
    "    \"xmax\": -11526060.571,\n",
    "    \"ymax\": 5909332.221,\n",
    "    \"spatialReference\": {\n",
    "        \"wkid\": 102100,\n",
    "        \"latestWkid\": 3857\n",
    "    }\n",
    "}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 111,
   "metadata": {},
   "outputs": [],
   "source": [
    "offline_item_properties = {\"title\": \"Offline area for mid-section of Merrifield Creek Subwatershed\",\n",
    "                          \"tags\": [\"Python\", \"automation\", \"hydrology\", \"wetlands\"],\n",
    "                          \"snippet\": \"Area created for updating wetlands and riparian areas in Little Missouri River basin.\"}\n",
    "\n",
    "merrifield_offline_item = wm_obj.offline_areas.create(\n",
    "    area = mfield_sub_extent,\n",
    "    item_properties = offline_item_properties,\n",
    "    min_scale = 126720,\n",
    "    max_scale = 0,\n",
    "    ignore_layers= flyrs_to_ignore,\n",
    "    folder=\"Wetlands_Inventory\",\n",
    "    tile_services=[\n",
    "        {\n",
    "            \"url\":base_url,\n",
    "            \"levels\":\"9,10,11,12,13\"\n",
    "        },\n",
    "        {\n",
    "            \"url\":detail_url,\n",
    "            \"levels\":\"9,10,11,12,13\"\n",
    "        },\n",
    "        {\n",
    "            \"url\":label_url,\n",
    "            \"levels\":\"9,10,11,12,13\"\n",
    "        }\n",
    "    ]\n",
    ")                                                  "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Using the same _list()_ method as above, we can now see that we have two _Map Area_ items for this web map."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 119,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<Item title:\"Offline area for mid-section of Merrifield Creek Subwatershed\" type:Map Area owner:api_data_owner>\n",
      "<Item title:\"Offline area for Lower Garner Creek Subwatershed\" type:Map Area owner:api_data_owner>\n"
     ]
    }
   ],
   "source": [
    "for wm_oma in wm_obj.offline_areas.list():\n",
    "    print(wm_oma)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Create offline areas from a specific polygon"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We can also create an offline map area using an instance of a _polygon_ [geometry](/python/api-reference/arcgis.geometry.html#polygon) to define the geographic area. We can extract a polygon from one of our layers."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 113,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'Sub_Watershed Boundaries'"
      ]
     },
     "execution_count": 113,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "wm_obj.content.layers[1].properties.name"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 114,
   "metadata": {},
   "outputs": [],
   "source": [
    "from arcgis.geometry import Polygon\n",
    "\n",
    "subwatershed_lyr = wm_obj.content.layers[1]\n",
    "bear_ck = subwatershed_lyr.query(where=\"name = 'Bear Creek'\").features[0]\n",
    "bear_ck_poly = Polygon(bear_ck.geometry)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 125,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/svg+xml": [
       "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"300\" height=\"300\" viewBox=\"-581367.855012001 2654150.022888 17732.695824000984 7776.214323999826\" preserveAspectRatio=\"xMinYMin meet\"><g transform=\"matrix(1,0,0,-1,0,5316076.2601)\"><path fill-rule=\"evenodd\" fill=\"#66cc99\" stroke=\"#555555\" stroke-width=\"118.21797216000657\" opacity=\"0.6\" d=\"M -564350.3915,2656895.6312 L -564309.0129,2656833.8564 L -564291.9257,2656765.2514 L -564311.163899999,2656734.3362 L -564322.9781,2656703.2556 L -564325.472100001,2656673.8095 L -564331.558499999,2656649.9762 L -564312.494000001,2656586.8576 L -564354.765900001,2656521.4261 L -564376.020300001,2656483.1809 L -564363.743799999,2656449.7155 L -564372.0055,2656411.1793 L -564348.592399999,2656377.4652 L -564338.131899999,2656345.885 L -564318.9483,2656288.2946 L -564334.3565,2656262.8256 L -564352.0189,2656218.9684 L -564335.169500001,2656139.3025 L -564327.0043,2656087.4913 L -564338.8991,2656052.7238 L -564393.206800001,2656031.8146 L -564459.830399999,2656042.5275 L -564520.6468,2656064.174 L -564572.0229,2656092.9835 L -564596.153100001,2656093.5243 L -564620.443399999,2656086.6927 L -564632.137599999,2656061.1403 L -564674.7662,2655979.1202 L -564701.43,2655948.3718 L -564770.827400001,2655916.7363 L -564816.091399999,2655884.5609 L -564903.5066,2655792.4811 L -564946.5572,2655776.8503 L -565002.4409,2655768.883 L -565052.358999999,2655779.2207 L -565111.0791,2655811.882 L -565137.1054,2655810.6205 L -565184.226600001,2655778.4865 L -565254.3375,2655713.6764 L -565265.912799999,2655693.6522 L -565255.5715,2655656.543 L -565241.439300001,2655623.0355 L -565212.1785,2655602.0979 L -565222.4944,2655554.387 L -565235.8061,2655539.9334 L -565299.712200001,2655504.4869 L -565309.391000001,2655486.2648 L -565286.0569,2655448.8632 L -565270.0701,2655415.315 L -565283.817600001,2655380.5884 L -565306.6886,2655353.4412 L -565444.4816,2655336.2449 L -565463.2421,2655327.4454 L -565477.031199999,2655290.8751 L -565486.5506,2655280.0241 L -565582.9911,2655285.8727 L -565607.318299999,2655277.1978 L -565628.571900001,2655238.9511 L -565655.192399999,2655221.6117 L -565692.5922,2655209.5416 L -565745.917099999,2655148.0412 L -565675.0952,2654987.8775 L -565716.9246,2654942.7161 L -565740.9352,2654948.7851 L -565765.2621,2654940.1102 L -565795.200099999,2654929.7164 L -565821.186699999,2654930.2981 L -565855.072799999,2654908.9295 L -565895.947699999,2654908.001 L -565914.190099999,2654923.1605 L -565954.029200001,2654970.1511 L -565976.1434,2654978.0212 L -566019.1127,2654966.0752 L -566054.5778,2654957.6495 L -566101.920600001,2655001.1197 L -566126.0902,2654999.8171 L -566152.6327,2654974.596 L -566190.551200001,2654938.5651 L -566223.920600001,2654941.1564 L -566249.9857,2654938.0514 L -566266.345699999,2654868.3478 L -566285.345100001,2654848.4893 L -566351.182800001,2654809.3958 L -566399.5207,2654806.7894 L -566440.235099999,2654813.2317 L -566494.1022,2654812.5932 L -566476.562200001,2654850.9236 L -566480.924900001,2654993.0037 L -566524.5965,2655034.5466 L -566576.208699999,2655052.2966 L -566625.9662,2655070.005 L -566686.9792,2655082.4323 L -566729.312200001,2655099.9744 L -566796.7623,2655142.9804 L -566849.205700001,2655186.391 L -566861.2238,2655213.3577 L -566859.9298,2655243.0327 L -566953.427999999,2655385.2595 L -566992.0887,2655400.8756 L -567114.3541,2655414.6711 L -567177.540999999,2655412.3942 L -567259.2499,2655412.3775 L -567296.5307,2655405.8336 L -567345.424699999,2655377.4243 L -567373.782199999,2655354.0876 L -567439.2225,2655333.4229 L -567509.7941,2655333.156 L -567554.261,2655337.8363 L -567608.832900001,2655390.6844 L -567675.721999999,2655475.1534 L -567715.214600001,2655513.7559 L -567724.4882,2655538.9343 L -567758.2689,2655581.5262 L -567795.288899999,2655614.2705 L -567800.531500001,2655715.8008 L -567858.935000001,2655763.201 L -567884.286,2655793.27 L -567920.179300001,2655851.2301 L -568050.4244,2655839.387 L -568084.112600001,2655827.2318 L -568096.24,2655781.4062 L -568135.5755,2655765.6892 L -568200.0242,2655791.0972 L -568229.205800001,2655815.7191 L -568284.176000001,2655850.1349 L -568346.887,2655869.9735 L -568394.947899999,2655880.2648 L -568423.932499999,2655914.1002 L -568468.1633,2655929.8384 L -568527.319599999,2655942.2207 L -568623.2827,2655970.1752 L -568688.4451,2655962.4092 L -568780.3792,2656005.0237 L -568885.464600001,2656040.5566 L -568932.7732,2656085.8622 L -568978.8982,2656099.7983 L -569045.832599999,2656182.4187 L -569062.537900001,2656182.7912 L -569129.9517,2656156.6366 L -569160.0052,2656140.7117 L -569196.1384,2656187.6132 L -569244.001599999,2656207.118 L -569263.270199999,2656261.0191 L -569277.803200001,2656276.0922 L -569298.1406,2656280.2332 L -569325.8248,2656288.2257 L -569351.019200001,2656325.6632 L -569394.972200001,2656354.3003 L -569415.4286,2656352.9118 L -569432.292199999,2656345.9129 L -569456.9366,2656322.4919 L -569479.645199999,2656302.7152 L -569518.939300001,2656288.8406 L -569540.0658,2656286.3157 L -569567.1982,2656289.9154 L -569592.023,2656300.6641 L -569615.655099999,2656281.7757 L -569693.533,2656287.1981 L -569786.0615,2656302.1656 L -569861.608100001,2656329.6614 L -569925.9396,2656360.5941 L -569974.705399999,2656404.3794 L -569980.01,2656494.8944 L -570010.307,2656478.1251 L -570048.242900001,2656459.195 L -570077.8619,2656463.5421 L -570099.463199999,2656495.3676 L -570126.5931,2656529.1604 L -570159.8851,2656535.4325 L -570191.676000001,2656525.0778 L -570220.110200001,2656498.0529 L -570226.469799999,2656461.3188 L -570241.8321,2656437.6907 L -570275.479699999,2656427.377 L -570290.881200001,2656401.9067 L -570295.542199999,2656357.759 L -570317.578400001,2656369.3119 L -570400.0755,2656419.0866 L -570521.827,2656456.8277 L -570625.808800001,2656457.2976 L -570687.2576,2656449.4456 L -570713.085200001,2656457.3955 L -570760.317,2656506.384 L -570807.8244,2656542.4734 L -570842.4201,2656574.5874 L -570871.524800001,2656602.891 L -570901.0253,2656612.7659 L -570971.279899999,2656627.2346 L -571048.4482,2656665.8255 L -571093.903100001,2656711.0867 L -571130.236400001,2656748.7707 L -571197.8068,2656801.8985 L -571236.035499999,2656837.78 L -571309.136,2656892.8735 L -571365.965299999,2656927.3238 L -571492.5353,2656913.543 L -571572.426899999,2656911.6305 L -571665.3901,2656906.3203 L -571739.870999999,2656896.9115 L -571816.089299999,2656893.0734 L -571871.8124,2656892.4677 L -571912.4068,2656817.775 L -571941.1152,2656777.8501 L -571971.3255,2656754.5513 L -571988.543,2656730.9642 L -572041.0657,2656706.3175 L -572074.750600001,2656694.16 L -572106.974199999,2656663.5306 L -572157.3255,2656653.5864 L -572211.191199999,2656652.938 L -572252.9705,2656609.6153 L -572278.6361,2656538.2782 L -572305.567199999,2656494.6254 L -572332.6164,2656445.4442 L -572356.032,2656392.4936 L -572366.5733,2656333.727 L -572361.990800001,2656287.5302 L -572342.085999999,2656263.1195 L -572362.621300001,2656258.0442 L -572412.615,2656250.2522 L -572460.266100001,2656237.4715 L -572497.105799999,2656251.0978 L -572538.7093,2656273.015 L -572573.6602,2656288.5417 L -572597.630899999,2656296.448 L -572661.884099999,2656331.0623 L -572713.6568,2656341.4303 L -572731.6263,2656369.4853 L -572726.1809,2656450.4912 L -572736.845000001,2656472.8529 L -572741.7794,2656415.8053 L -572752.595799999,2656344.1375 L -572800.0198,2656297.2514 L -572835.914999999,2656268.548 L -572887.9342,2656232.4435 L -572913.1559,2656216.7909 L -572949.4099,2656258.1592 L -572965.8389,2656271.4303 L -573005.5239,2656239.1222 L -573041.3795,2656212.261 L -573073.327,2656194.5319 L -573093.742699999,2656194.9849 L -573122.9278,2656219.6008 L -573118.108100001,2656184.462 L -573106.1395,2656136.258 L -573128.6876,2656123.8514 L -573186.5001,2656112.2272 L -573221.5286,2656124.0672 L -573249.250700001,2656130.2132 L -573298.058800001,2656105.4822 L -573332.1371,2656074.894 L -573392.159299999,2656046.724 L -573433.5429,2656021.8284 L -573456.090600001,2656009.4226 L -573501.979,2656034.4088 L -573549.685699999,2656061.2796 L -573572.9421,2656079.6874 L -573605.0285,2656075.6677 L -573666.5483,2656107.0918 L -573706.0118,2656132.7183 L -573771.8994,2656173.0592 L -573796.5002,2656226.4833 L -573822.805199999,2656277.6144 L -573838.9355,2656307.6752 L -573873.537,2656318.027 L -573930.0348,2656337.0564 L -573963.561799999,2656332.2683 L -574017.111300001,2656346.3599 L -574059.092499999,2656380.4781 L -574100.8369,2656425.653 L -574109.929400001,2656521.73 L -574135.0493,2656562.8484 L -574168.064300001,2656582.0171 L -574219.2082,2656621.8687 L -574246.6163,2656642.7571 L -574251.241900001,2656687.1095 L -574278.8071,2656700.6261 L -574329.273700001,2656685.1499 L -574368.1722,2656689.6986 L -574383.776699999,2656741.6691 L -574379.5143,2656767.3873 L -574356.6132,2656796.3791 L -574301.374299999,2656861.5303 L -574278.354,2656896.0516 L -574258.889900001,2656938.0268 L -574254.4704,2656971.1166 L -574268.4933,2657010.1444 L -574295.626700001,2657043.9327 L -574352.3004,2657085.749 L -574392.584799999,2657112.453 L -574433.0251,2657131.7863 L -574468.133300001,2657139.9376 L -574501.463199999,2657144.3631 L -574525.121300001,2657167.0113 L -574554.5437,2657180.5694 L -574589.5734,2657192.4066 L -574618.6032,2657224.392 L -574651.462300001,2657250.9311 L -574682.347899999,2657282.9575 L -574674.0998,2657321.4918 L -574665.889799999,2657358.1849 L -574674.463500001,2657391.5616 L -574701.5584,2657427.1915 L -574726.248299999,2657488.5788 L -574737.7875,2657557.0513 L -574761.408,2657581.5414 L -574796.438100001,2657593.3787 L -574835.218800001,2657603.4552 L -574868.589500001,2657606.0367 L -574873.1765,2657652.2306 L -574901.9321,2657682.7106 L -574938.8968,2657705.3078 L -574953.353800001,2657724.0641 L -574962.1633,2657746.383 L -574993.010600001,2657780.2509 L -575033.176200001,2657812.4824 L -575051.9745,2657801.8357 L -575064.3676,2657772.6433 L -575118.1548,2657775.6769 L -575162.269400001,2657796.9321 L -575194.6598,2657845.5841 L -575243.2444,2657918.5617 L -575266.5496,2657957.7929 L -575314.729800001,2657962.5457 L -575311.6587,2658019.6312 L -575327.932499999,2658040.2716 L -575345.788699999,2658073.8504 L -575359.499199999,2658127.6213 L -575339.880000001,2658176.9658 L -575383.001800001,2658157.6385 L -575417.9936,2658171.3174 L -575439.7963,2658193.923 L -575503.6237,2658248.8001 L -575529.453500001,2658256.7449 L -575578.219699999,2658233.8556 L -575639.706599999,2658224.1518 L -575679.335899999,2658212.023 L -575749.1384,2658230.2572 L -575817.0262,2658251.802 L -575854.2532,2658308.1948 L -575877.1064,2658325.2662 L -575945.391100001,2658345.2104 L -576019.204600001,2658367.121 L -576101.8288,2658411.3492 L -576138.5787,2658393.5147 L -576171.949999999,2658366.8931 L -576196.8335,2658333.5932 L -576246.9301,2658288.404 L -576300.839600001,2658253.2562 L -576392.1392,2658228.8891 L -576462.5019,2658220.9847 L -576508.8233,2658214.0419 L -576554.282099999,2658216.0412 L -576614.303400001,2658241.2593 L -576652.416300001,2658268.9818 L -576687.488399999,2658302.6091 L -576733.4847,2658347.9271 L -576768.5361,2658382.5507 L -576815.264900001,2658444.3111 L -576836.7612,2658470.172 L -576868.193,2658492.2702 L -576886.738700001,2658499.1507 L -576903.4277,2658500.5138 L -576953.124500001,2658508.0816 L -576990.289899999,2658521.3459 L -577023.422499999,2658550.4503 L -577065.6054,2658585.727 L -577112.2818,2658624.0899 L -577153.512800001,2658644.4126 L -577182.3243,2658668.942 L -577213.8028,2658691.0404 L -577220.5166,2658697.2686 L -577242.641000001,2658731.4991 L -577295.373299999,2658784.2826 L -577349.9998,2658835.2635 L -577404.5912,2658888.0875 L -577467.1505,2658915.2767 L -577522.0919,2658951.5147 L -577536.2763,2658983.1691 L -577543.720899999,2659069.9812 L -577576.7798,2659087.3014 L -577670.816500001,2659118.8707 L -577740.802100001,2659146.2228 L -577768.097899999,2659172.6342 L -577826.7511,2659208.954 L -577851.995200001,2659244.538 L -577901.1731,2659289.8665 L -577945.8761,2659283.4764 L -577966.801100001,2659259.9715 L -577993.294199999,2659236.5884 L -578039.206700001,2659173.0756 L -578083.419600001,2659102.1498 L -578152.328,2659092.6064 L -578196.9924,2659088.0577 L -578215.8654,2659073.7261 L -578272.602299999,2659025.1993 L -578309.685900001,2659027.859 L -578350.364499999,2659036.1292 L -578407.395300001,2659061.3505 L -578468.9197,2659049.7999 L -578503.444499999,2659085.5866 L -578549.066099999,2659123.4624 L -578627.022399999,2659125.1783 L -578642.8068,2659081.2815 L -578667.2875,2659065.2279 L -578715.740900001,2659057.0765 L -578745.320499999,2659063.2577 L -578859.4232,2659111.8578 L -578901.9967,2659118.3248 L -578924.0056,2659147.0777 L -578962.311000001,2659180.5575 L -579014.930299999,2659222.2044 L -579038.138800001,2659178.47 L -579083.386299999,2659146.2808 L -579078.4421,2659116.6761 L -579093.913899999,2659087.5192 L -579143.068399999,2659046.1983 L -579177.889699999,2659072.7925 L -579228.706800001,2659123.6671 L -579303.676000001,2659178.7795 L -579351.35,2659207.4805 L -579375.6744,2659198.7978 L -579408.965299999,2659205.06 L -579451.1503,2659229.9541 L -579477.0186,2659236.0533 L -579505.1324,2659223.7663 L -579575.390900001,2659238.2157 L -579610.7732,2659233.4631 L -579717.699200001,2659182.3497 L -579755.4432,2659153.6832 L -579774.627699999,2659124.608 L -579782.2358,2659092.6635 L -579770.205399999,2659043.01 L -579779.287900001,2658991.9754 L -579800.794299999,2658940.8284 L -579818.510500001,2658893.2852 L -579853.399700001,2658823.997 L -579880.1634,2658787.7142 L -579923.514799999,2658757.3256 L -579939.024900001,2658726.3259 L -579930.3289,2658698.4818 L -579941.6982,2658687.6709 L -579990.267000001,2658673.9888 L -580048.1547,2658658.6686 L -580067.299900001,2658631.4359 L -580110.688899999,2658599.2047 L -580131.806500001,2658566.485 L -580118.672700001,2658485.0789 L -580116.048599999,2658433.4009 L -580130.975500001,2658430.0426 L -580175.753599999,2658419.9643 L -580256.4969,2658377.4917 L -580339.525,2658314.791 L -580437.283500001,2658257.9444 L -580626.7249,2658168.0817 L -580658.432399999,2658161.4045 L -580654.786699999,2658246.1296 L -580702.3046,2658378.0569 L -580711.088500001,2658384.2003 L -580707.578400001,2658396.4307 L -580676.0832,2658410.2559 L -580601.744200001,2658471.7237 L -580569.2181,2658517.0983 L -580575.592,2658567.0151 L -580610.8068,2658658.1221 L -580638.2073,2658767.4936 L -580658.184699999,2658876.702 L -580691.272500001,2658980.6661 L -580710.6273,2659119.3567 L -580701.2984,2659209.4852 L -580690.5407,2659279.303 L -580641.7775,2659302.1978 L -580602.216600001,2659328.982 L -580575.6094,2659357.8945 L -580576.765000001,2659391.1036 L -580591.031099999,2659419.0693 L -580620.067500001,2659451.0462 L -580655.9833,2659508.9834 L -580675.389699999,2659557.3409 L -580699.4792,2659559.7136 L -580668.4978,2659619.8685 L -580643.825999999,2659645.1371 L -580607.822799999,2659679.3724 L -580607.238600001,2659707.0126 L -580619.2984,2659751.5204 L -580585.071799999,2659789.4827 L -580588.045600001,2659824.5743 L -580597.899800001,2659885.626 L -580579.9509,2659944.2241 L -580529.4857,2659959.7084 L -580471.8687,2659962.1298 L -580415.8751,2659975.6501 L -580389.8508,2659976.9206 L -580358.647,2659959.6441 L -580313.3617,2659993.6749 L -580272.059900001,2660014.8911 L -580218.0394,2660022.9223 L -580174.5318,2660060.6803 L -580105.1938,2660090.4977 L -580026.886399999,2660105.3686 L -579943.4419,2660099.8487 L -579895.2193,2660096.9464 L -579836.862600001,2660134.3779 L -579828.231699999,2660191.3365 L -579794.004899999,2660229.2978 L -579793.264799999,2660264.3066 L -579807.530999999,2660292.2727 L -579754.263499999,2660440.424 L -579698.1972,2660721.242 L -579661.624199999,2660958.2445 L -579643.3627,2661031.5812 L -579604.605,2661108.1535 L -579549.648,2661160.4047 L -579510.707800001,2661157.7072 L -579394.623199999,2661114.6004 L -579188.1698,2661041.8567 L -579084.3785,2661032.2013 L -579022.930500001,2661040.0677 L -578947.358899999,2661101.0842 L -578862.156099999,2661178.4789 L -578773.1644,2661259.4769 L -578724.667099999,2661269.4707 L -578684.0644,2661257.5177 L -578499.976199999,2661093.0887 L -578424.3774,2661067.4613 L -578367.770099999,2661021.9722 L -578280.387,2660938.9377 L -578156.3106,2660834.8168 L -578113.8506,2660822.821 L -578065.6283,2660819.9167 L -577997.2993,2660801.821 L -577949.1173,2660797.0734 L -577868.3573,2660770.9933 L -577800.964400001,2660762.5255 L -577757.877900001,2660745.9742 L -577727.659499999,2660731.3625 L -577696.143200001,2660728.8245 L -577610.522299999,2660738.0002 L -577568.9849,2660770.2684 L -577564.3752,2660812.5671 L -577557.211200001,2660886.8909 L -577558.569399999,2660914.6631 L -577539.755000001,2660919.0492 L -577500.468499999,2660936.5154 L -577413.108999999,2660940.1222 L -577380.320900001,2660909.9041 L -577367.912599999,2660881.9789 L -577286.161699999,2660883.864 L -577234.6557,2660860.6065 L -577185.317600001,2660822.6511 L -577045.945800001,2660826.9542 L -577003.642999999,2660807.5863 L -576900.190099999,2660781.8988 L -576849.6558,2660800.5048 L -576800.144400001,2660858.4055 L -576730.604499999,2660897.4288 L -576690.7643,2660937.1077 L -576638.0886,2660969.1274 L -576588.234999999,2660971.637 L -576482.472100001,2660987.7392 L -576464.285,2661020.6007 L -576417.4889,2661038.0031 L -576384.2333,2661029.8956 L -576314.593699999,2660985.961 L -576261.231899999,2660962.6603 L -576207.518300001,2660955.9462 L -576166.563899999,2660960.572 L -576104.310699999,2661093.7721 L -576073.7125,2661135.4982 L -576034.418400001,2661149.3787 L -575988.793,2661111.5029 L -575948.542099999,2661082.9629 L -575926.2281,2661084.3135 L -575900.4164,2661163.0135 L -575824.934599999,2661131.8517 L -575804.125499999,2661149.8271 L -575769.8532,2661189.628 L -575749.434,2661189.1772 L -575652.5371,2661116.9862 L -575562.676000001,2661063.3846 L -575507.1919,2661036.534 L -575467.2446,2661009.6587 L -575332.833900001,2660955.0733 L -575310.4154,2660924.2928 L -575170.0504,2660935.5846 L -575157.2982,2660952.3972 L -575144.6076,2660985.9424 L -575118.738299999,2660979.8408 L -575066.372300001,2660997.1187 L -575039.8365,2661022.3414 L -575009.626,2661045.6401 L -574869.293400001,2661007.5131 L -574827.1994,2660967.6226 L -574790.9079,2660976.195 L -574782.962400001,2661020.3204 L -574761.609999999,2661005.68 L -574714.906300001,2660989.3212 L -574685.4025,2660979.4506 L -574621.425799999,2660984.7849 L -574585.257099999,2661060.1946 L -574545.336100001,2661103.5571 L -574495.6075,2661084.0221 L -574414.362500001,2661061.948 L -574321.031500001,2660995.8741 L -574224.240800001,2660984.9506 L -574176.239600001,2660954.1745 L -574114.178400001,2660942.8557 L -574088.3079,2660936.7531 L -574074.726,2660964.1052 L -574046.6077,2660976.3878 L -574014.8159,2660986.7462 L -574010.3584,2661021.6733 L -573982.1226,2661039.4825 L -573936.9597,2661039.4079 L -573883.8179,2661033.6225 L -573855.344599999,2661062.4882 L -573830.743799999,2661084.0667 L -573750.1642,2661030.6653 L -573742.3728,2660960.4395 L -573693.822000001,2660885.6241 L -573659.3772,2660846.148 L -573617.8972,2660788.0805 L -573496.873,2660715.3476 L -573399.4321,2660668.9448 L -573322.253900001,2660630.3667 L -573235.479599999,2660606.3228 L -573097.4869,2660632.7628 L -572980.8937,2660613.5892 L -572931.7031,2660605.38 L -572870.333699999,2660621.4678 L -572829.278200001,2660669.2235 L -572728.252699999,2660703.8565 L -572693.1019,2660697.5451 L -572597.0055,2660675.1385 L -572552.258199999,2660683.3643 L -572449.062000001,2660732.6947 L -572370.586999999,2660754.9226 L -572244.358100001,2660752.1234 L -572017.8971,2660833.7499 L -571993.8835,2660827.6869 L -571942.967800001,2660776.7813 L -571911.8432,2660755.8116 L -571847.501,2660724.8887 L -571854.524599999,2660656.8323 L -571829.283299999,2660621.2449 L -571789.192,2660585.328 L -571682.3528,2660544.2428 L -571644.392899999,2660495.4677 L -571584.905200001,2660411.1871 L -571564.447000001,2660412.5771 L -571483.523499999,2660462.4015 L -571440.5145,2660476.1941 L -571399.320699999,2660491.8734 L -571338.929300001,2660449.9745 L -571269.845899999,2660380.2283 L -571227.386700001,2660368.2239 L -571191.9585,2660374.8107 L -571146.7006,2660406.9927 L -571103.5318,2660428.1563 L -571073.6741,2660434.868 L -571032.9527,2660428.4322 L -570983.3838,2660401.5212 L -570945.1898,2660363.8009 L -570910.7863,2660322.4791 L -570818.398600001,2660213.4994 L -570758.204,2660162.3846 L -570712.111099999,2660146.6123 L -570665.467700001,2660156.636 L -570592.716700001,2660171.6131 L -570557.2487,2660180.0429 L -570501.9958,2660158.5362 L -570424.975500001,2660112.5771 L -570359.094599999,2660066.8666 L -570330.575999999,2660010.9241 L -570339.5392,2659939.2229 L -570367.183,2659862.4063 L -570386.967800001,2659805.6939 L -570358.055400001,2659768.1783 L -570306.2379,2659759.6525 L -570248.574899999,2659763.9002 L -570189.8849,2659729.4109 L -570152.004799999,2659676.9468 L -570104.687899999,2659631.6477 L -570058.558499999,2659617.7163 L -569959.858899999,2659630.2711 L -569874.5481,2659624.686 L -569785.9987,2659596.9053 L -569697.9233,2659547.0114 L -569630.0295,2659508.6284 L -569572.8398,2659490.7626 L -569498.469799999,2659494.6384 L -569396.5714,2659483.1526 L -569332.469799999,2659441.1647 L -569284.918,2659406.9197 L -569249.530099999,2659411.6647 L -569177.015699999,2659415.5812 L -569116.192500001,2659393.9465 L -569060.938899999,2659372.4367 L -569058.0549,2659420.3074 L -569069.8638,2659475.8794 L -569061.728399999,2659508.8845 L -569029.4197,2659543.1944 L -568993.478599999,2659573.7359 L -568938.934800001,2659605.7065 L -568893.237600001,2659658.1555 L -568853.2289,2659705.1983 L -568805.951300001,2659744.7064 L -568783.5175,2659751.5794 L -568752.4859,2659714.0577 L -568701.9542,2659629.8435 L -568661.8325,2659536.8509 L -568585.0156,2659481.6728 L -568462.1832,2659407.0343 L -568346.422900001,2659349.1443 L -568293.143999999,2659322.1454 L -568244.250399999,2659263.9017 L -568221.7761,2659272.6193 L -568142.3484,2659339.0649 L -568094.0459,2659339.8315 L -568029.3903,2659323.64 L -567665.874199999,2659214.1311 L -567446.6324,2659218.4591 L -567223.993100001,2659207.9591 L -567198.361,2659190.7948 L -567188.966700001,2659109.462 L -567215.329,2658833.4952 L -567197.3265,2658720.6264 L -567174.740700001,2658648.2175 L -567120.280400001,2658589.8465 L -567055.746099999,2658568.1245 L -566922.093800001,2658565.14 L -566884.9279,2658566.1542 L -566844.248400001,2658557.8694 L -566658.222899999,2658572.1536 L -566578.6029,2658561.1564 L -566500.8345,2658550.1982 L -566447.755999999,2658513.9825 L -566384.2929,2658442.5023 L -566313.644200001,2658359.7972 L -566265.618799999,2658347.6628 L -566175.176200001,2658321.6731 L -566142.1209,2658304.3403 L -566122.415899999,2658270.7117 L -566101.728399999,2658196.4999 L -566076.227,2658087.1476 L -566035.3586,2658001.4199 L -566004.9945,2657945.4286 L -565955.033399999,2657936.9359 L -565877.268200001,2657925.9781 L -565759.0626,2657895.6779 L -565687.026000001,2657877.4726 L -565624.8774,2657745.1734 L -565518.975199999,2657575.0179 L -565479.2895,2657520.6598 L -565437.1547,2657482.3376 L -565386.295600001,2657429.5726 L -565361.896400001,2657355.2737 L -565349.737500001,2657316.2815 L -565146.6768,2657173.4497 L -565117.2152,2657161.7266 L -565094.7415,2657170.4435 L -565056.702,2657211.9989 L -565002.910800001,2657208.95 L -564973.2106,2657208.286 L -564918.1195,2657179.3943 L -564877.5211,2657167.4225 L -564835.823100001,2657120.3933 L -564783.2247,2657062.0563 L -564733.8627,2657025.9186 L -564699.071799999,2657003.0123 L -564650.8094,2657001.93 L -564555.0012,2656966.5947 L -564481.851600001,2656999.9888 L -564405.5057,2657009.3405 L -564382.5688,2656953.5117 L -564350.3915,2656895.6312 z\" /></g></svg>"
      ],
      "text/plain": [
       "{'rings': [[[-564350.3915, 2656895.6312],\n",
       "   [-564309.0129, 2656833.8564],\n",
       "   [-564291.9257, 2656765.2514],\n",
       "   [-564311.163899999, 2656734.3362],\n",
       "   [-564322.9781, 2656703.2556],\n",
       "   [-564325.472100001, 2656673.8095],\n",
       "   [-564331.558499999, 2656649.9762],\n",
       "   [-564312.494000001, 2656586.8576],\n",
       "   [-564354.765900001, 2656521.4261],\n",
       "   [-564376.020300001, 2656483.1809],\n",
       "   [-564363.743799999, 2656449.7155],\n",
       "   [-564372.0055, 2656411.1793],\n",
       "   [-564348.592399999, 2656377.4652],\n",
       "   [-564338.131899999, 2656345.885],\n",
       "   [-564318.9483, 2656288.2946],\n",
       "   [-564334.3565, 2656262.8256],\n",
       "   [-564352.0189, 2656218.9684],\n",
       "   [-564335.169500001, 2656139.3025],\n",
       "   [-564327.0043, 2656087.4913],\n",
       "   [-564338.8991, 2656052.7238],\n",
       "   [-564393.206800001, 2656031.8146],\n",
       "   [-564459.830399999, 2656042.5275],\n",
       "   [-564520.6468, 2656064.174],\n",
       "   [-564572.0229, 2656092.9835],\n",
       "   [-564596.153100001, 2656093.5243],\n",
       "   [-564620.443399999, 2656086.6927],\n",
       "   [-564632.137599999, 2656061.1403],\n",
       "   [-564674.7662, 2655979.1202],\n",
       "   [-564701.43, 2655948.3718],\n",
       "   [-564770.827400001, 2655916.7363],\n",
       "   [-564816.091399999, 2655884.5609],\n",
       "   [-564903.5066, 2655792.4811],\n",
       "   [-564946.5572, 2655776.8503],\n",
       "   [-565002.4409, 2655768.883],\n",
       "   [-565052.358999999, 2655779.2207],\n",
       "   [-565111.0791, 2655811.882],\n",
       "   [-565137.1054, 2655810.6205],\n",
       "   [-565184.226600001, 2655778.4865],\n",
       "   [-565254.3375, 2655713.6764],\n",
       "   [-565265.912799999, 2655693.6522],\n",
       "   [-565255.5715, 2655656.543],\n",
       "   [-565241.439300001, 2655623.0355],\n",
       "   [-565212.1785, 2655602.0979],\n",
       "   [-565222.4944, 2655554.387],\n",
       "   [-565235.8061, 2655539.9334],\n",
       "   [-565299.712200001, 2655504.4869],\n",
       "   [-565309.391000001, 2655486.2648],\n",
       "   [-565286.0569, 2655448.8632],\n",
       "   [-565270.0701, 2655415.315],\n",
       "   [-565283.817600001, 2655380.5884],\n",
       "   [-565306.6886, 2655353.4412],\n",
       "   [-565444.4816, 2655336.2449],\n",
       "   [-565463.2421, 2655327.4454],\n",
       "   [-565477.031199999, 2655290.8751],\n",
       "   [-565486.5506, 2655280.0241],\n",
       "   [-565582.9911, 2655285.8727],\n",
       "   [-565607.318299999, 2655277.1978],\n",
       "   [-565628.571900001, 2655238.9511],\n",
       "   [-565655.192399999, 2655221.6117],\n",
       "   [-565692.5922, 2655209.5416],\n",
       "   [-565745.917099999, 2655148.0412],\n",
       "   [-565675.0952, 2654987.8775],\n",
       "   [-565716.9246, 2654942.7161],\n",
       "   [-565740.9352, 2654948.7851],\n",
       "   [-565765.2621, 2654940.1102],\n",
       "   [-565795.200099999, 2654929.7164],\n",
       "   [-565821.186699999, 2654930.2981],\n",
       "   [-565855.072799999, 2654908.9295],\n",
       "   [-565895.947699999, 2654908.001],\n",
       "   [-565914.190099999, 2654923.1605],\n",
       "   [-565954.029200001, 2654970.1511],\n",
       "   [-565976.1434, 2654978.0212],\n",
       "   [-566019.1127, 2654966.0752],\n",
       "   [-566054.5778, 2654957.6495],\n",
       "   [-566101.920600001, 2655001.1197],\n",
       "   [-566126.0902, 2654999.8171],\n",
       "   [-566152.6327, 2654974.596],\n",
       "   [-566190.551200001, 2654938.5651],\n",
       "   [-566223.920600001, 2654941.1564],\n",
       "   [-566249.9857, 2654938.0514],\n",
       "   [-566266.345699999, 2654868.3478],\n",
       "   [-566285.345100001, 2654848.4893],\n",
       "   [-566351.182800001, 2654809.3958],\n",
       "   [-566399.5207, 2654806.7894],\n",
       "   [-566440.235099999, 2654813.2317],\n",
       "   [-566494.1022, 2654812.5932],\n",
       "   [-566476.562200001, 2654850.9236],\n",
       "   [-566480.924900001, 2654993.0037],\n",
       "   [-566524.5965, 2655034.5466],\n",
       "   [-566576.208699999, 2655052.2966],\n",
       "   [-566625.9662, 2655070.005],\n",
       "   [-566686.9792, 2655082.4323],\n",
       "   [-566729.312200001, 2655099.9744],\n",
       "   [-566796.7623, 2655142.9804],\n",
       "   [-566849.205700001, 2655186.391],\n",
       "   [-566861.2238, 2655213.3577],\n",
       "   [-566859.9298, 2655243.0327],\n",
       "   [-566953.427999999, 2655385.2595],\n",
       "   [-566992.0887, 2655400.8756],\n",
       "   [-567114.3541, 2655414.6711],\n",
       "   [-567177.540999999, 2655412.3942],\n",
       "   [-567259.2499, 2655412.3775],\n",
       "   [-567296.5307, 2655405.8336],\n",
       "   [-567345.424699999, 2655377.4243],\n",
       "   [-567373.782199999, 2655354.0876],\n",
       "   [-567439.2225, 2655333.4229],\n",
       "   [-567509.7941, 2655333.156],\n",
       "   [-567554.261, 2655337.8363],\n",
       "   [-567608.832900001, 2655390.6844],\n",
       "   [-567675.721999999, 2655475.1534],\n",
       "   [-567715.214600001, 2655513.7559],\n",
       "   [-567724.4882, 2655538.9343],\n",
       "   [-567758.2689, 2655581.5262],\n",
       "   [-567795.288899999, 2655614.2705],\n",
       "   [-567800.531500001, 2655715.8008],\n",
       "   [-567858.935000001, 2655763.201],\n",
       "   [-567884.286, 2655793.27],\n",
       "   [-567920.179300001, 2655851.2301],\n",
       "   [-568050.4244, 2655839.387],\n",
       "   [-568084.112600001, 2655827.2318],\n",
       "   [-568096.24, 2655781.4062],\n",
       "   [-568135.5755, 2655765.6892],\n",
       "   [-568200.0242, 2655791.0972],\n",
       "   [-568229.205800001, 2655815.7191],\n",
       "   [-568284.176000001, 2655850.1349],\n",
       "   [-568346.887, 2655869.9735],\n",
       "   [-568394.947899999, 2655880.2648],\n",
       "   [-568423.932499999, 2655914.1002],\n",
       "   [-568468.1633, 2655929.8384],\n",
       "   [-568527.319599999, 2655942.2207],\n",
       "   [-568623.2827, 2655970.1752],\n",
       "   [-568688.4451, 2655962.4092],\n",
       "   [-568780.3792, 2656005.0237],\n",
       "   [-568885.464600001, 2656040.5566],\n",
       "   [-568932.7732, 2656085.8622],\n",
       "   [-568978.8982, 2656099.7983],\n",
       "   [-569045.832599999, 2656182.4187],\n",
       "   [-569062.537900001, 2656182.7912],\n",
       "   [-569129.9517, 2656156.6366],\n",
       "   [-569160.0052, 2656140.7117],\n",
       "   [-569196.1384, 2656187.6132],\n",
       "   [-569244.001599999, 2656207.118],\n",
       "   [-569263.270199999, 2656261.0191],\n",
       "   [-569277.803200001, 2656276.0922],\n",
       "   [-569298.1406, 2656280.2332],\n",
       "   [-569325.8248, 2656288.2257],\n",
       "   [-569351.019200001, 2656325.6632],\n",
       "   [-569394.972200001, 2656354.3003],\n",
       "   [-569415.4286, 2656352.9118],\n",
       "   [-569432.292199999, 2656345.9129],\n",
       "   [-569456.9366, 2656322.4919],\n",
       "   [-569479.645199999, 2656302.7152],\n",
       "   [-569518.939300001, 2656288.8406],\n",
       "   [-569540.0658, 2656286.3157],\n",
       "   [-569567.1982, 2656289.9154],\n",
       "   [-569592.023, 2656300.6641],\n",
       "   [-569615.655099999, 2656281.7757],\n",
       "   [-569693.533, 2656287.1981],\n",
       "   [-569786.0615, 2656302.1656],\n",
       "   [-569861.608100001, 2656329.6614],\n",
       "   [-569925.9396, 2656360.5941],\n",
       "   [-569974.705399999, 2656404.3794],\n",
       "   [-569980.01, 2656494.8944],\n",
       "   [-570010.307, 2656478.1251],\n",
       "   [-570048.242900001, 2656459.195],\n",
       "   [-570077.8619, 2656463.5421],\n",
       "   [-570099.463199999, 2656495.3676],\n",
       "   [-570126.5931, 2656529.1604],\n",
       "   [-570159.8851, 2656535.4325],\n",
       "   [-570191.676000001, 2656525.0778],\n",
       "   [-570220.110200001, 2656498.0529],\n",
       "   [-570226.469799999, 2656461.3188],\n",
       "   [-570241.8321, 2656437.6907],\n",
       "   [-570275.479699999, 2656427.377],\n",
       "   [-570290.881200001, 2656401.9067],\n",
       "   [-570295.542199999, 2656357.759],\n",
       "   [-570317.578400001, 2656369.3119],\n",
       "   [-570400.0755, 2656419.0866],\n",
       "   [-570521.827, 2656456.8277],\n",
       "   [-570625.808800001, 2656457.2976],\n",
       "   [-570687.2576, 2656449.4456],\n",
       "   [-570713.085200001, 2656457.3955],\n",
       "   [-570760.317, 2656506.384],\n",
       "   [-570807.8244, 2656542.4734],\n",
       "   [-570842.4201, 2656574.5874],\n",
       "   [-570871.524800001, 2656602.891],\n",
       "   [-570901.0253, 2656612.7659],\n",
       "   [-570971.279899999, 2656627.2346],\n",
       "   [-571048.4482, 2656665.8255],\n",
       "   [-571093.903100001, 2656711.0867],\n",
       "   [-571130.236400001, 2656748.7707],\n",
       "   [-571197.8068, 2656801.8985],\n",
       "   [-571236.035499999, 2656837.78],\n",
       "   [-571309.136, 2656892.8735],\n",
       "   [-571365.965299999, 2656927.3238],\n",
       "   [-571492.5353, 2656913.543],\n",
       "   [-571572.426899999, 2656911.6305],\n",
       "   [-571665.3901, 2656906.3203],\n",
       "   [-571739.870999999, 2656896.9115],\n",
       "   [-571816.089299999, 2656893.0734],\n",
       "   [-571871.8124, 2656892.4677],\n",
       "   [-571912.4068, 2656817.775],\n",
       "   [-571941.1152, 2656777.8501],\n",
       "   [-571971.3255, 2656754.5513],\n",
       "   [-571988.543, 2656730.9642],\n",
       "   [-572041.0657, 2656706.3175],\n",
       "   [-572074.750600001, 2656694.16],\n",
       "   [-572106.974199999, 2656663.5306],\n",
       "   [-572157.3255, 2656653.5864],\n",
       "   [-572211.191199999, 2656652.938],\n",
       "   [-572252.9705, 2656609.6153],\n",
       "   [-572278.6361, 2656538.2782],\n",
       "   [-572305.567199999, 2656494.6254],\n",
       "   [-572332.6164, 2656445.4442],\n",
       "   [-572356.032, 2656392.4936],\n",
       "   [-572366.5733, 2656333.727],\n",
       "   [-572361.990800001, 2656287.5302],\n",
       "   [-572342.085999999, 2656263.1195],\n",
       "   [-572362.621300001, 2656258.0442],\n",
       "   [-572412.615, 2656250.2522],\n",
       "   [-572460.266100001, 2656237.4715],\n",
       "   [-572497.105799999, 2656251.0978],\n",
       "   [-572538.7093, 2656273.015],\n",
       "   [-572573.6602, 2656288.5417],\n",
       "   [-572597.630899999, 2656296.448],\n",
       "   [-572661.884099999, 2656331.0623],\n",
       "   [-572713.6568, 2656341.4303],\n",
       "   [-572731.6263, 2656369.4853],\n",
       "   [-572726.1809, 2656450.4912],\n",
       "   [-572736.845000001, 2656472.8529],\n",
       "   [-572741.7794, 2656415.8053],\n",
       "   [-572752.595799999, 2656344.1375],\n",
       "   [-572800.0198, 2656297.2514],\n",
       "   [-572835.914999999, 2656268.548],\n",
       "   [-572887.9342, 2656232.4435],\n",
       "   [-572913.1559, 2656216.7909],\n",
       "   [-572949.4099, 2656258.1592],\n",
       "   [-572965.8389, 2656271.4303],\n",
       "   [-573005.5239, 2656239.1222],\n",
       "   [-573041.3795, 2656212.261],\n",
       "   [-573073.327, 2656194.5319],\n",
       "   [-573093.742699999, 2656194.9849],\n",
       "   [-573122.9278, 2656219.6008],\n",
       "   [-573118.108100001, 2656184.462],\n",
       "   [-573106.1395, 2656136.258],\n",
       "   [-573128.6876, 2656123.8514],\n",
       "   [-573186.5001, 2656112.2272],\n",
       "   [-573221.5286, 2656124.0672],\n",
       "   [-573249.250700001, 2656130.2132],\n",
       "   [-573298.058800001, 2656105.4822],\n",
       "   [-573332.1371, 2656074.894],\n",
       "   [-573392.159299999, 2656046.724],\n",
       "   [-573433.5429, 2656021.8284],\n",
       "   [-573456.090600001, 2656009.4226],\n",
       "   [-573501.979, 2656034.4088],\n",
       "   [-573549.685699999, 2656061.2796],\n",
       "   [-573572.9421, 2656079.6874],\n",
       "   [-573605.0285, 2656075.6677],\n",
       "   [-573666.5483, 2656107.0918],\n",
       "   [-573706.0118, 2656132.7183],\n",
       "   [-573771.8994, 2656173.0592],\n",
       "   [-573796.5002, 2656226.4833],\n",
       "   [-573822.805199999, 2656277.6144],\n",
       "   [-573838.9355, 2656307.6752],\n",
       "   [-573873.537, 2656318.027],\n",
       "   [-573930.0348, 2656337.0564],\n",
       "   [-573963.561799999, 2656332.2683],\n",
       "   [-574017.111300001, 2656346.3599],\n",
       "   [-574059.092499999, 2656380.4781],\n",
       "   [-574100.8369, 2656425.653],\n",
       "   [-574109.929400001, 2656521.73],\n",
       "   [-574135.0493, 2656562.8484],\n",
       "   [-574168.064300001, 2656582.0171],\n",
       "   [-574219.2082, 2656621.8687],\n",
       "   [-574246.6163, 2656642.7571],\n",
       "   [-574251.241900001, 2656687.1095],\n",
       "   [-574278.8071, 2656700.6261],\n",
       "   [-574329.273700001, 2656685.1499],\n",
       "   [-574368.1722, 2656689.6986],\n",
       "   [-574383.776699999, 2656741.6691],\n",
       "   [-574379.5143, 2656767.3873],\n",
       "   [-574356.6132, 2656796.3791],\n",
       "   [-574301.374299999, 2656861.5303],\n",
       "   [-574278.354, 2656896.0516],\n",
       "   [-574258.889900001, 2656938.0268],\n",
       "   [-574254.4704, 2656971.1166],\n",
       "   [-574268.4933, 2657010.1444],\n",
       "   [-574295.626700001, 2657043.9327],\n",
       "   [-574352.3004, 2657085.749],\n",
       "   [-574392.584799999, 2657112.453],\n",
       "   [-574433.0251, 2657131.7863],\n",
       "   [-574468.133300001, 2657139.9376],\n",
       "   [-574501.463199999, 2657144.3631],\n",
       "   [-574525.121300001, 2657167.0113],\n",
       "   [-574554.5437, 2657180.5694],\n",
       "   [-574589.5734, 2657192.4066],\n",
       "   [-574618.6032, 2657224.392],\n",
       "   [-574651.462300001, 2657250.9311],\n",
       "   [-574682.347899999, 2657282.9575],\n",
       "   [-574674.0998, 2657321.4918],\n",
       "   [-574665.889799999, 2657358.1849],\n",
       "   [-574674.463500001, 2657391.5616],\n",
       "   [-574701.5584, 2657427.1915],\n",
       "   [-574726.248299999, 2657488.5788],\n",
       "   [-574737.7875, 2657557.0513],\n",
       "   [-574761.408, 2657581.5414],\n",
       "   [-574796.438100001, 2657593.3787],\n",
       "   [-574835.218800001, 2657603.4552],\n",
       "   [-574868.589500001, 2657606.0367],\n",
       "   [-574873.1765, 2657652.2306],\n",
       "   [-574901.9321, 2657682.7106],\n",
       "   [-574938.8968, 2657705.3078],\n",
       "   [-574953.353800001, 2657724.0641],\n",
       "   [-574962.1633, 2657746.383],\n",
       "   [-574993.010600001, 2657780.2509],\n",
       "   [-575033.176200001, 2657812.4824],\n",
       "   [-575051.9745, 2657801.8357],\n",
       "   [-575064.3676, 2657772.6433],\n",
       "   [-575118.1548, 2657775.6769],\n",
       "   [-575162.269400001, 2657796.9321],\n",
       "   [-575194.6598, 2657845.5841],\n",
       "   [-575243.2444, 2657918.5617],\n",
       "   [-575266.5496, 2657957.7929],\n",
       "   [-575314.729800001, 2657962.5457],\n",
       "   [-575311.6587, 2658019.6312],\n",
       "   [-575327.932499999, 2658040.2716],\n",
       "   [-575345.788699999, 2658073.8504],\n",
       "   [-575359.499199999, 2658127.6213],\n",
       "   [-575339.880000001, 2658176.9658],\n",
       "   [-575383.001800001, 2658157.6385],\n",
       "   [-575417.9936, 2658171.3174],\n",
       "   [-575439.7963, 2658193.923],\n",
       "   [-575503.6237, 2658248.8001],\n",
       "   [-575529.453500001, 2658256.7449],\n",
       "   [-575578.219699999, 2658233.8556],\n",
       "   [-575639.706599999, 2658224.1518],\n",
       "   [-575679.335899999, 2658212.023],\n",
       "   [-575749.1384, 2658230.2572],\n",
       "   [-575817.0262, 2658251.802],\n",
       "   [-575854.2532, 2658308.1948],\n",
       "   [-575877.1064, 2658325.2662],\n",
       "   [-575945.391100001, 2658345.2104],\n",
       "   [-576019.204600001, 2658367.121],\n",
       "   [-576101.8288, 2658411.3492],\n",
       "   [-576138.5787, 2658393.5147],\n",
       "   [-576171.949999999, 2658366.8931],\n",
       "   [-576196.8335, 2658333.5932],\n",
       "   [-576246.9301, 2658288.404],\n",
       "   [-576300.839600001, 2658253.2562],\n",
       "   [-576392.1392, 2658228.8891],\n",
       "   [-576462.5019, 2658220.9847],\n",
       "   [-576508.8233, 2658214.0419],\n",
       "   [-576554.282099999, 2658216.0412],\n",
       "   [-576614.303400001, 2658241.2593],\n",
       "   [-576652.416300001, 2658268.9818],\n",
       "   [-576687.488399999, 2658302.6091],\n",
       "   [-576733.4847, 2658347.9271],\n",
       "   [-576768.5361, 2658382.5507],\n",
       "   [-576815.264900001, 2658444.3111],\n",
       "   [-576836.7612, 2658470.172],\n",
       "   [-576868.193, 2658492.2702],\n",
       "   [-576886.738700001, 2658499.1507],\n",
       "   [-576903.4277, 2658500.5138],\n",
       "   [-576953.124500001, 2658508.0816],\n",
       "   [-576990.289899999, 2658521.3459],\n",
       "   [-577023.422499999, 2658550.4503],\n",
       "   [-577065.6054, 2658585.727],\n",
       "   [-577112.2818, 2658624.0899],\n",
       "   [-577153.512800001, 2658644.4126],\n",
       "   [-577182.3243, 2658668.942],\n",
       "   [-577213.8028, 2658691.0404],\n",
       "   [-577220.5166, 2658697.2686],\n",
       "   [-577242.641000001, 2658731.4991],\n",
       "   [-577295.373299999, 2658784.2826],\n",
       "   [-577349.9998, 2658835.2635],\n",
       "   [-577404.5912, 2658888.0875],\n",
       "   [-577467.1505, 2658915.2767],\n",
       "   [-577522.0919, 2658951.5147],\n",
       "   [-577536.2763, 2658983.1691],\n",
       "   [-577543.720899999, 2659069.9812],\n",
       "   [-577576.7798, 2659087.3014],\n",
       "   [-577670.816500001, 2659118.8707],\n",
       "   [-577740.802100001, 2659146.2228],\n",
       "   [-577768.097899999, 2659172.6342],\n",
       "   [-577826.7511, 2659208.954],\n",
       "   [-577851.995200001, 2659244.538],\n",
       "   [-577901.1731, 2659289.8665],\n",
       "   [-577945.8761, 2659283.4764],\n",
       "   [-577966.801100001, 2659259.9715],\n",
       "   [-577993.294199999, 2659236.5884],\n",
       "   [-578039.206700001, 2659173.0756],\n",
       "   [-578083.419600001, 2659102.1498],\n",
       "   [-578152.328, 2659092.6064],\n",
       "   [-578196.9924, 2659088.0577],\n",
       "   [-578215.8654, 2659073.7261],\n",
       "   [-578272.602299999, 2659025.1993],\n",
       "   [-578309.685900001, 2659027.859],\n",
       "   [-578350.364499999, 2659036.1292],\n",
       "   [-578407.395300001, 2659061.3505],\n",
       "   [-578468.9197, 2659049.7999],\n",
       "   [-578503.444499999, 2659085.5866],\n",
       "   [-578549.066099999, 2659123.4624],\n",
       "   [-578627.022399999, 2659125.1783],\n",
       "   [-578642.8068, 2659081.2815],\n",
       "   [-578667.2875, 2659065.2279],\n",
       "   [-578715.740900001, 2659057.0765],\n",
       "   [-578745.320499999, 2659063.2577],\n",
       "   [-578859.4232, 2659111.8578],\n",
       "   [-578901.9967, 2659118.3248],\n",
       "   [-578924.0056, 2659147.0777],\n",
       "   [-578962.311000001, 2659180.5575],\n",
       "   [-579014.930299999, 2659222.2044],\n",
       "   [-579038.138800001, 2659178.47],\n",
       "   [-579083.386299999, 2659146.2808],\n",
       "   [-579078.4421, 2659116.6761],\n",
       "   [-579093.913899999, 2659087.5192],\n",
       "   [-579143.068399999, 2659046.1983],\n",
       "   [-579177.889699999, 2659072.7925],\n",
       "   [-579228.706800001, 2659123.6671],\n",
       "   [-579303.676000001, 2659178.7795],\n",
       "   [-579351.35, 2659207.4805],\n",
       "   [-579375.6744, 2659198.7978],\n",
       "   [-579408.965299999, 2659205.06],\n",
       "   [-579451.1503, 2659229.9541],\n",
       "   [-579477.0186, 2659236.0533],\n",
       "   [-579505.1324, 2659223.7663],\n",
       "   [-579575.390900001, 2659238.2157],\n",
       "   [-579610.7732, 2659233.4631],\n",
       "   [-579717.699200001, 2659182.3497],\n",
       "   [-579755.4432, 2659153.6832],\n",
       "   [-579774.627699999, 2659124.608],\n",
       "   [-579782.2358, 2659092.6635],\n",
       "   [-579770.205399999, 2659043.01],\n",
       "   [-579779.287900001, 2658991.9754],\n",
       "   [-579800.794299999, 2658940.8284],\n",
       "   [-579818.510500001, 2658893.2852],\n",
       "   [-579853.399700001, 2658823.997],\n",
       "   [-579880.1634, 2658787.7142],\n",
       "   [-579923.514799999, 2658757.3256],\n",
       "   [-579939.024900001, 2658726.3259],\n",
       "   [-579930.3289, 2658698.4818],\n",
       "   [-579941.6982, 2658687.6709],\n",
       "   [-579990.267000001, 2658673.9888],\n",
       "   [-580048.1547, 2658658.6686],\n",
       "   [-580067.299900001, 2658631.4359],\n",
       "   [-580110.688899999, 2658599.2047],\n",
       "   [-580131.806500001, 2658566.485],\n",
       "   [-580118.672700001, 2658485.0789],\n",
       "   [-580116.048599999, 2658433.4009],\n",
       "   [-580130.975500001, 2658430.0426],\n",
       "   [-580175.753599999, 2658419.9643],\n",
       "   [-580256.4969, 2658377.4917],\n",
       "   [-580339.525, 2658314.791],\n",
       "   [-580437.283500001, 2658257.9444],\n",
       "   [-580626.7249, 2658168.0817],\n",
       "   [-580658.432399999, 2658161.4045],\n",
       "   [-580654.786699999, 2658246.1296],\n",
       "   [-580702.3046, 2658378.0569],\n",
       "   [-580711.088500001, 2658384.2003],\n",
       "   [-580707.578400001, 2658396.4307],\n",
       "   [-580676.0832, 2658410.2559],\n",
       "   [-580601.744200001, 2658471.7237],\n",
       "   [-580569.2181, 2658517.0983],\n",
       "   [-580575.592, 2658567.0151],\n",
       "   [-580610.8068, 2658658.1221],\n",
       "   [-580638.2073, 2658767.4936],\n",
       "   [-580658.184699999, 2658876.702],\n",
       "   [-580691.272500001, 2658980.6661],\n",
       "   [-580710.6273, 2659119.3567],\n",
       "   [-580701.2984, 2659209.4852],\n",
       "   [-580690.5407, 2659279.303],\n",
       "   [-580641.7775, 2659302.1978],\n",
       "   [-580602.216600001, 2659328.982],\n",
       "   [-580575.6094, 2659357.8945],\n",
       "   [-580576.765000001, 2659391.1036],\n",
       "   [-580591.031099999, 2659419.0693],\n",
       "   [-580620.067500001, 2659451.0462],\n",
       "   [-580655.9833, 2659508.9834],\n",
       "   [-580675.389699999, 2659557.3409],\n",
       "   [-580699.4792, 2659559.7136],\n",
       "   [-580668.4978, 2659619.8685],\n",
       "   [-580643.825999999, 2659645.1371],\n",
       "   [-580607.822799999, 2659679.3724],\n",
       "   [-580607.238600001, 2659707.0126],\n",
       "   [-580619.2984, 2659751.5204],\n",
       "   [-580585.071799999, 2659789.4827],\n",
       "   [-580588.045600001, 2659824.5743],\n",
       "   [-580597.899800001, 2659885.626],\n",
       "   [-580579.9509, 2659944.2241],\n",
       "   [-580529.4857, 2659959.7084],\n",
       "   [-580471.8687, 2659962.1298],\n",
       "   [-580415.8751, 2659975.6501],\n",
       "   [-580389.8508, 2659976.9206],\n",
       "   [-580358.647, 2659959.6441],\n",
       "   [-580313.3617, 2659993.6749],\n",
       "   [-580272.059900001, 2660014.8911],\n",
       "   [-580218.0394, 2660022.9223],\n",
       "   [-580174.5318, 2660060.6803],\n",
       "   [-580105.1938, 2660090.4977],\n",
       "   [-580026.886399999, 2660105.3686],\n",
       "   [-579943.4419, 2660099.8487],\n",
       "   [-579895.2193, 2660096.9464],\n",
       "   [-579836.862600001, 2660134.3779],\n",
       "   [-579828.231699999, 2660191.3365],\n",
       "   [-579794.004899999, 2660229.2978],\n",
       "   [-579793.264799999, 2660264.3066],\n",
       "   [-579807.530999999, 2660292.2727],\n",
       "   [-579754.263499999, 2660440.424],\n",
       "   [-579698.1972, 2660721.242],\n",
       "   [-579661.624199999, 2660958.2445],\n",
       "   [-579643.3627, 2661031.5812],\n",
       "   [-579604.605, 2661108.1535],\n",
       "   [-579549.648, 2661160.4047],\n",
       "   [-579510.707800001, 2661157.7072],\n",
       "   [-579394.623199999, 2661114.6004],\n",
       "   [-579188.1698, 2661041.8567],\n",
       "   [-579084.3785, 2661032.2013],\n",
       "   [-579022.930500001, 2661040.0677],\n",
       "   [-578947.358899999, 2661101.0842],\n",
       "   [-578862.156099999, 2661178.4789],\n",
       "   [-578773.1644, 2661259.4769],\n",
       "   [-578724.667099999, 2661269.4707],\n",
       "   [-578684.0644, 2661257.5177],\n",
       "   [-578499.976199999, 2661093.0887],\n",
       "   [-578424.3774, 2661067.4613],\n",
       "   [-578367.770099999, 2661021.9722],\n",
       "   [-578280.387, 2660938.9377],\n",
       "   [-578156.3106, 2660834.8168],\n",
       "   [-578113.8506, 2660822.821],\n",
       "   [-578065.6283, 2660819.9167],\n",
       "   [-577997.2993, 2660801.821],\n",
       "   [-577949.1173, 2660797.0734],\n",
       "   [-577868.3573, 2660770.9933],\n",
       "   [-577800.964400001, 2660762.5255],\n",
       "   [-577757.877900001, 2660745.9742],\n",
       "   [-577727.659499999, 2660731.3625],\n",
       "   [-577696.143200001, 2660728.8245],\n",
       "   [-577610.522299999, 2660738.0002],\n",
       "   [-577568.9849, 2660770.2684],\n",
       "   [-577564.3752, 2660812.5671],\n",
       "   [-577557.211200001, 2660886.8909],\n",
       "   [-577558.569399999, 2660914.6631],\n",
       "   [-577539.755000001, 2660919.0492],\n",
       "   [-577500.468499999, 2660936.5154],\n",
       "   [-577413.108999999, 2660940.1222],\n",
       "   [-577380.320900001, 2660909.9041],\n",
       "   [-577367.912599999, 2660881.9789],\n",
       "   [-577286.161699999, 2660883.864],\n",
       "   [-577234.6557, 2660860.6065],\n",
       "   [-577185.317600001, 2660822.6511],\n",
       "   [-577045.945800001, 2660826.9542],\n",
       "   [-577003.642999999, 2660807.5863],\n",
       "   [-576900.190099999, 2660781.8988],\n",
       "   [-576849.6558, 2660800.5048],\n",
       "   [-576800.144400001, 2660858.4055],\n",
       "   [-576730.604499999, 2660897.4288],\n",
       "   [-576690.7643, 2660937.1077],\n",
       "   [-576638.0886, 2660969.1274],\n",
       "   [-576588.234999999, 2660971.637],\n",
       "   [-576482.472100001, 2660987.7392],\n",
       "   [-576464.285, 2661020.6007],\n",
       "   [-576417.4889, 2661038.0031],\n",
       "   [-576384.2333, 2661029.8956],\n",
       "   [-576314.593699999, 2660985.961],\n",
       "   [-576261.231899999, 2660962.6603],\n",
       "   [-576207.518300001, 2660955.9462],\n",
       "   [-576166.563899999, 2660960.572],\n",
       "   [-576104.310699999, 2661093.7721],\n",
       "   [-576073.7125, 2661135.4982],\n",
       "   [-576034.418400001, 2661149.3787],\n",
       "   [-575988.793, 2661111.5029],\n",
       "   [-575948.542099999, 2661082.9629],\n",
       "   [-575926.2281, 2661084.3135],\n",
       "   [-575900.4164, 2661163.0135],\n",
       "   [-575824.934599999, 2661131.8517],\n",
       "   [-575804.125499999, 2661149.8271],\n",
       "   [-575769.8532, 2661189.628],\n",
       "   [-575749.434, 2661189.1772],\n",
       "   [-575652.5371, 2661116.9862],\n",
       "   [-575562.676000001, 2661063.3846],\n",
       "   [-575507.1919, 2661036.534],\n",
       "   [-575467.2446, 2661009.6587],\n",
       "   [-575332.833900001, 2660955.0733],\n",
       "   [-575310.4154, 2660924.2928],\n",
       "   [-575170.0504, 2660935.5846],\n",
       "   [-575157.2982, 2660952.3972],\n",
       "   [-575144.6076, 2660985.9424],\n",
       "   [-575118.738299999, 2660979.8408],\n",
       "   [-575066.372300001, 2660997.1187],\n",
       "   [-575039.8365, 2661022.3414],\n",
       "   [-575009.626, 2661045.6401],\n",
       "   [-574869.293400001, 2661007.5131],\n",
       "   [-574827.1994, 2660967.6226],\n",
       "   [-574790.9079, 2660976.195],\n",
       "   [-574782.962400001, 2661020.3204],\n",
       "   [-574761.609999999, 2661005.68],\n",
       "   [-574714.906300001, 2660989.3212],\n",
       "   [-574685.4025, 2660979.4506],\n",
       "   [-574621.425799999, 2660984.7849],\n",
       "   [-574585.257099999, 2661060.1946],\n",
       "   [-574545.336100001, 2661103.5571],\n",
       "   [-574495.6075, 2661084.0221],\n",
       "   [-574414.362500001, 2661061.948],\n",
       "   [-574321.031500001, 2660995.8741],\n",
       "   [-574224.240800001, 2660984.9506],\n",
       "   [-574176.239600001, 2660954.1745],\n",
       "   [-574114.178400001, 2660942.8557],\n",
       "   [-574088.3079, 2660936.7531],\n",
       "   [-574074.726, 2660964.1052],\n",
       "   [-574046.6077, 2660976.3878],\n",
       "   [-574014.8159, 2660986.7462],\n",
       "   [-574010.3584, 2661021.6733],\n",
       "   [-573982.1226, 2661039.4825],\n",
       "   [-573936.9597, 2661039.4079],\n",
       "   [-573883.8179, 2661033.6225],\n",
       "   [-573855.344599999, 2661062.4882],\n",
       "   [-573830.743799999, 2661084.0667],\n",
       "   [-573750.1642, 2661030.6653],\n",
       "   [-573742.3728, 2660960.4395],\n",
       "   [-573693.822000001, 2660885.6241],\n",
       "   [-573659.3772, 2660846.148],\n",
       "   [-573617.8972, 2660788.0805],\n",
       "   [-573496.873, 2660715.3476],\n",
       "   [-573399.4321, 2660668.9448],\n",
       "   [-573322.253900001, 2660630.3667],\n",
       "   [-573235.479599999, 2660606.3228],\n",
       "   [-573097.4869, 2660632.7628],\n",
       "   [-572980.8937, 2660613.5892],\n",
       "   [-572931.7031, 2660605.38],\n",
       "   [-572870.333699999, 2660621.4678],\n",
       "   [-572829.278200001, 2660669.2235],\n",
       "   [-572728.252699999, 2660703.8565],\n",
       "   [-572693.1019, 2660697.5451],\n",
       "   [-572597.0055, 2660675.1385],\n",
       "   [-572552.258199999, 2660683.3643],\n",
       "   [-572449.062000001, 2660732.6947],\n",
       "   [-572370.586999999, 2660754.9226],\n",
       "   [-572244.358100001, 2660752.1234],\n",
       "   [-572017.8971, 2660833.7499],\n",
       "   [-571993.8835, 2660827.6869],\n",
       "   [-571942.967800001, 2660776.7813],\n",
       "   [-571911.8432, 2660755.8116],\n",
       "   [-571847.501, 2660724.8887],\n",
       "   [-571854.524599999, 2660656.8323],\n",
       "   [-571829.283299999, 2660621.2449],\n",
       "   [-571789.192, 2660585.328],\n",
       "   [-571682.3528, 2660544.2428],\n",
       "   [-571644.392899999, 2660495.4677],\n",
       "   [-571584.905200001, 2660411.1871],\n",
       "   [-571564.447000001, 2660412.5771],\n",
       "   [-571483.523499999, 2660462.4015],\n",
       "   [-571440.5145, 2660476.1941],\n",
       "   [-571399.320699999, 2660491.8734],\n",
       "   [-571338.929300001, 2660449.9745],\n",
       "   [-571269.845899999, 2660380.2283],\n",
       "   [-571227.386700001, 2660368.2239],\n",
       "   [-571191.9585, 2660374.8107],\n",
       "   [-571146.7006, 2660406.9927],\n",
       "   [-571103.5318, 2660428.1563],\n",
       "   [-571073.6741, 2660434.868],\n",
       "   [-571032.9527, 2660428.4322],\n",
       "   [-570983.3838, 2660401.5212],\n",
       "   [-570945.1898, 2660363.8009],\n",
       "   [-570910.7863, 2660322.4791],\n",
       "   [-570818.398600001, 2660213.4994],\n",
       "   [-570758.204, 2660162.3846],\n",
       "   [-570712.111099999, 2660146.6123],\n",
       "   [-570665.467700001, 2660156.636],\n",
       "   [-570592.716700001, 2660171.6131],\n",
       "   [-570557.2487, 2660180.0429],\n",
       "   [-570501.9958, 2660158.5362],\n",
       "   [-570424.975500001, 2660112.5771],\n",
       "   [-570359.094599999, 2660066.8666],\n",
       "   [-570330.575999999, 2660010.9241],\n",
       "   [-570339.5392, 2659939.2229],\n",
       "   [-570367.183, 2659862.4063],\n",
       "   [-570386.967800001, 2659805.6939],\n",
       "   [-570358.055400001, 2659768.1783],\n",
       "   [-570306.2379, 2659759.6525],\n",
       "   [-570248.574899999, 2659763.9002],\n",
       "   [-570189.8849, 2659729.4109],\n",
       "   [-570152.004799999, 2659676.9468],\n",
       "   [-570104.687899999, 2659631.6477],\n",
       "   [-570058.558499999, 2659617.7163],\n",
       "   [-569959.858899999, 2659630.2711],\n",
       "   [-569874.5481, 2659624.686],\n",
       "   [-569785.9987, 2659596.9053],\n",
       "   [-569697.9233, 2659547.0114],\n",
       "   [-569630.0295, 2659508.6284],\n",
       "   [-569572.8398, 2659490.7626],\n",
       "   [-569498.469799999, 2659494.6384],\n",
       "   [-569396.5714, 2659483.1526],\n",
       "   [-569332.469799999, 2659441.1647],\n",
       "   [-569284.918, 2659406.9197],\n",
       "   [-569249.530099999, 2659411.6647],\n",
       "   [-569177.015699999, 2659415.5812],\n",
       "   [-569116.192500001, 2659393.9465],\n",
       "   [-569060.938899999, 2659372.4367],\n",
       "   [-569058.0549, 2659420.3074],\n",
       "   [-569069.8638, 2659475.8794],\n",
       "   [-569061.728399999, 2659508.8845],\n",
       "   [-569029.4197, 2659543.1944],\n",
       "   [-568993.478599999, 2659573.7359],\n",
       "   [-568938.934800001, 2659605.7065],\n",
       "   [-568893.237600001, 2659658.1555],\n",
       "   [-568853.2289, 2659705.1983],\n",
       "   [-568805.951300001, 2659744.7064],\n",
       "   [-568783.5175, 2659751.5794],\n",
       "   [-568752.4859, 2659714.0577],\n",
       "   [-568701.9542, 2659629.8435],\n",
       "   [-568661.8325, 2659536.8509],\n",
       "   [-568585.0156, 2659481.6728],\n",
       "   [-568462.1832, 2659407.0343],\n",
       "   [-568346.422900001, 2659349.1443],\n",
       "   [-568293.143999999, 2659322.1454],\n",
       "   [-568244.250399999, 2659263.9017],\n",
       "   [-568221.7761, 2659272.6193],\n",
       "   [-568142.3484, 2659339.0649],\n",
       "   [-568094.0459, 2659339.8315],\n",
       "   [-568029.3903, 2659323.64],\n",
       "   [-567665.874199999, 2659214.1311],\n",
       "   [-567446.6324, 2659218.4591],\n",
       "   [-567223.993100001, 2659207.9591],\n",
       "   [-567198.361, 2659190.7948],\n",
       "   [-567188.966700001, 2659109.462],\n",
       "   [-567215.329, 2658833.4952],\n",
       "   [-567197.3265, 2658720.6264],\n",
       "   [-567174.740700001, 2658648.2175],\n",
       "   [-567120.280400001, 2658589.8465],\n",
       "   [-567055.746099999, 2658568.1245],\n",
       "   [-566922.093800001, 2658565.14],\n",
       "   [-566884.9279, 2658566.1542],\n",
       "   [-566844.248400001, 2658557.8694],\n",
       "   [-566658.222899999, 2658572.1536],\n",
       "   [-566578.6029, 2658561.1564],\n",
       "   [-566500.8345, 2658550.1982],\n",
       "   [-566447.755999999, 2658513.9825],\n",
       "   [-566384.2929, 2658442.5023],\n",
       "   [-566313.644200001, 2658359.7972],\n",
       "   [-566265.618799999, 2658347.6628],\n",
       "   [-566175.176200001, 2658321.6731],\n",
       "   [-566142.1209, 2658304.3403],\n",
       "   [-566122.415899999, 2658270.7117],\n",
       "   [-566101.728399999, 2658196.4999],\n",
       "   [-566076.227, 2658087.1476],\n",
       "   [-566035.3586, 2658001.4199],\n",
       "   [-566004.9945, 2657945.4286],\n",
       "   [-565955.033399999, 2657936.9359],\n",
       "   [-565877.268200001, 2657925.9781],\n",
       "   [-565759.0626, 2657895.6779],\n",
       "   [-565687.026000001, 2657877.4726],\n",
       "   [-565624.8774, 2657745.1734],\n",
       "   [-565518.975199999, 2657575.0179],\n",
       "   [-565479.2895, 2657520.6598],\n",
       "   [-565437.1547, 2657482.3376],\n",
       "   [-565386.295600001, 2657429.5726],\n",
       "   [-565361.896400001, 2657355.2737],\n",
       "   [-565349.737500001, 2657316.2815],\n",
       "   [-565146.6768, 2657173.4497],\n",
       "   [-565117.2152, 2657161.7266],\n",
       "   [-565094.7415, 2657170.4435],\n",
       "   [-565056.702, 2657211.9989],\n",
       "   [-565002.910800001, 2657208.95],\n",
       "   [-564973.2106, 2657208.286],\n",
       "   [-564918.1195, 2657179.3943],\n",
       "   [-564877.5211, 2657167.4225],\n",
       "   [-564835.823100001, 2657120.3933],\n",
       "   [-564783.2247, 2657062.0563],\n",
       "   [-564733.8627, 2657025.9186],\n",
       "   [-564699.071799999, 2657003.0123],\n",
       "   [-564650.8094, 2657001.93],\n",
       "   [-564555.0012, 2656966.5947],\n",
       "   [-564481.851600001, 2656999.9888],\n",
       "   [-564405.5057, 2657009.3405],\n",
       "   [-564382.5688, 2656953.5117],\n",
       "   [-564350.3915, 2656895.6312]]],\n",
       " 'spatialReference': {'wkt': 'PROJCS[\"NAD_1983_Albers\",GEOGCS[\"GCS_North_American_1983\",DATUM[\"D_North_American_1983\",SPHEROID[\"GRS_1980\",6378137.0,298.257222101]],PRIMEM[\"Greenwich\",0.0],UNIT[\"Degree\",0.0174532925199433]],PROJECTION[\"Albers\"],PARAMETER[\"False_Easting\",0.0],PARAMETER[\"False_Northing\",0.0],PARAMETER[\"Central_Meridian\",-96.0],PARAMETER[\"Standard_Parallel_1\",29.5],PARAMETER[\"Standard_Parallel_2\",45.5],PARAMETER[\"Latitude_Of_Origin\",23.0],UNIT[\"Meter\",1.0]]'}}"
      ]
     },
     "execution_count": 125,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "bear_ck_poly"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 116,
   "metadata": {},
   "outputs": [],
   "source": [
    "offline_item_properties = {\"title\": \"Offline area for Bear Creek Subwatershed\",\n",
    "                          \"tags\": [\"Python\", \"automation\", \"hydrology\", \"wetlands\"],\n",
    "                          \"snippet\": \"Area created for updating wetlands and riparian areas in Bear Creek subwatershed in the Little Missouri River basin.\"}\n",
    "\n",
    "bear_creek_offline_item = wm_obj.offline_areas.create(\n",
    "    area = bear_ck_poly,\n",
    "    item_properties = offline_item_properties,\n",
    "    min_scale = 210000,\n",
    "    max_scale = 0,\n",
    "    ignore_layers= flyrs_to_ignore,\n",
    "    folder=\"Wetlands_Inventory\",\n",
    "    tile_services=[\n",
    "        {\n",
    "            \"url\":base_url,\n",
    "            \"levels\":\"9,10,11,12,13\"\n",
    "        },\n",
    "        {\n",
    "            \"url\":detail_url,\n",
    "            \"levels\":\"9,10,11,12,13\"\n",
    "        },\n",
    "        {\n",
    "            \"url\":label_url,\n",
    "            \"levels\":\"9,10,11,12,13\"\n",
    "        }\n",
    "    ]\n",
    ")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We've used three different ways of specifying a geographic area to create offline mapping ares for our web map. Now it's time to inspect the _Map Area_ items to get some additional information. As we saw earlier, the _create()_ method results in _items_ with a _type_ attribute of _Map Area_. We can loop through our list to see this:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Offline Area for Lower Garner Creek Subwatershed                 Map Area\n",
      "Offline area for mid-section of Merrifield Creek Subwatershed    Map Area\n",
      "Offline area for Bear Creek Subwatershed                         Map Area\n"
     ]
    }
   ],
   "source": [
    "for oma_item in wm_obj.offline_areas.list():\n",
    "    print(f\"{oma_item.title:65}{oma_item.type}\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Inspecting offline packages created for a map area"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "When you create an offline map area, the data for the specified extent is bundled into one or many packages for downloading depending upon the types of layers in the _web map_. _Feature Layers_ are packaged into mobile geodatabases, while _tile layers_ and _vector tile layers_ are bundled into tile packages and vector tile packages, respectively. See the [Create and manager offline map areas documentation](https://doc.arcgis.com/en/arcgis-online/manage-data/take-maps-offline.htm#ESRI_SECTION1_8C6055E984D34AF4A25B989DDCAACF87) for details.\n",
    "\n",
    "The packages created for a `Map Area` item share a relationship with the item. The relationship type is an `Area2Package` relation with a forward direction. See the [Relationship types](/rest/users-groups-and-items/relationship-types.htm) documentation for a comprehensive list of possible relations between items. Any _item_ has the [`related_items()`](/python/api-reference/arcgis.gis.toc.html#arcgis.gis.Item.related_items) method from which you can retrieve the items that participate in the specific relationship type:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 120,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Offline area for Bear Creek Subwatershed shares the `Area2Package` relationship with: \n",
      "--------------------------------------------------\n",
      "  VectorTileServe-f22a2b78d51b42d4a33245f3182ff08e       \n",
      "    Vector Tile Package\n",
      "  Middle_Little_Missouri_SubBasin_Wetlands_and_Riparian_Areas-ba4441141ab04c259fd4deb11b3388d9\n",
      "    SQLite Geodatabase\n",
      "\n",
      "\n",
      "Offline area for mid-section of Merrifield Creek Subwatershed shares the `Area2Package` relationship with: \n",
      "--------------------------------------------------\n",
      "  VectorTileServe-231eda57e6864977a0dd22aba2e66536       \n",
      "    Vector Tile Package\n",
      "  Middle_Little_Missouri_SubBasin_Wetlands_and_Riparian_Areas-8568af2abb5a49f1b50cea9a4c4f6602\n",
      "    SQLite Geodatabase\n",
      "\n",
      "\n",
      "Offline area for Lower Garner Creek Subwatershed shares the `Area2Package` relationship with: \n",
      "--------------------------------------------------\n",
      "  Middle_Little_Missouri_SubBasin_Wetlands_and_Riparian_Areas-5e781bac510e41eb857a877b6b2f752a\n",
      "    SQLite Geodatabase\n",
      "  VectorTileServe-b9b01536150f45969c9905e9650e5dc8       \n",
      "    Vector Tile Package\n",
      "\n",
      "\n"
     ]
    }
   ],
   "source": [
    "for oma_item in wm_obj.offline_areas.list():\n",
    "    print(f\"{oma_item.title} shares the `Area2Package` relationship with: \\n{'-' * 50}\")\n",
    "    for rel_item in oma_item.related_items('Area2Package', 'forward'):\n",
    "        print(f\"{' '*2}{rel_item.title:55}\\n{' '*4}{rel_item.type}\")\n",
    "    print(\"\\n\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "These items are meant for use in offline applications like _ArcGIS Field Maps_, [ArcGIS Survey123](https://doc.arcgis.com/en/survey123/desktop/create-surveys/preparebasemaps.htm), or [ArcGIS Runtime SDK](https://links.esri.com/agol-help/runtime-sdk/offline) applications. If needed, you can call the [`download()`](/python/api-reference/arcgis.gis.toc.html#arcgis.gis.Item.download) method of the _Map Area item_ to download the data to disk."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Updating offline areas\n",
    "The layer data used to create the offline map areas may change, so keeping offline areas up to date is an important task.  The [`update()`](/python/api-reference/arcgis.map.toc.html#arcgis.map.OfflineMapAreaManager.update) method of the _OfflineMapAreaManager_ class accomplishes this. The method accepts a _list_ of _Map Area items_ as input. If no _items_ are specified in the `items` argument, all _map area items_ for the _web map_ get updated. \n",
    "\n",
    "Below is an example of how the progress is relayed back to you when you turn on the `verbosity` in the `env` module."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 121,
   "metadata": {},
   "outputs": [],
   "source": [
    "from arcgis import env\n",
    "env.verbose=True"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 124,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Submitted.\n",
      "Executing...\n",
      "Start Time: Monday, August 19, 2024 7:00:08 PM\n",
      "World_Basemap_v2/VectorTileServer - Check if export URL is different from service URL.\n",
      "World_Basemap_v2/VectorTileServer - Submitting export vector tile job:https://basemaps.arcgis.com/arcgis/rest/services/World_Basemap_v2/VectorTileServer/exportTiles\n",
      "World_Basemap_v2/VectorTileServer - Job url:https://basemaps.arcgis.com/arcgis/rest/services/World_Basemap_v2/VectorTileServer/jobs/87d4bd6a20683a98\n",
      "Middle_Little_Missouri_SubBasin_Wetlands_and_Riparian_Areas/FeatureServer - Get Service Definition\n",
      "Middle_Little_Missouri_SubBasin_Wetlands_and_Riparian_Areas/FeatureServer - Submit sync job\n",
      "Middle_Little_Missouri_SubBasin_Wetlands_and_Riparian_Areas/FeatureServer - Submitting sync job:https://services7.arcgis.com/YoUrOrgANIzATIon/arcgis/rest/services/Middle_Little_Missouri_SubBasin_Wetlands_and_Riparian_Areas/FeatureServer/synchronizeReplica\n",
      "Middle_Little_Missouri_SubBasin_Wetlands_and_Riparian_Areas/FeatureServer - Job url :https://services7.arcgis.com/YoUrOrgANIzATIon/arcgis/rest/services/Middle_Little_Missouri_SubBasin_Wetlands_and_Riparian_Areas/FeatureServer/jobs/bf9eb299-15e5-492d-be66-cdeef0184c8e\n",
      "World_Basemap_v2/VectorTileServer - Check if export URL is different from service URL.\n",
      "World_Basemap_v2/VectorTileServer - Submitting export vector tile job:https://basemaps.arcgis.com/arcgis/rest/services/World_Basemap_v2/VectorTileServer/exportTiles\n",
      "World_Basemap_v2/VectorTileServer - Job url:https://basemaps.arcgis.com/arcgis/rest/services/World_Basemap_v2/VectorTileServer/jobs/92ff7dbe214b7b01\n",
      "Middle_Little_Missouri_SubBasin_Wetlands_and_Riparian_Areas/FeatureServer - Get Service Definition\n",
      "Middle_Little_Missouri_SubBasin_Wetlands_and_Riparian_Areas/FeatureServer - Submit sync job\n",
      "Middle_Little_Missouri_SubBasin_Wetlands_and_Riparian_Areas/FeatureServer - Submitting sync job:https://services7.arcgis.com/YoUrOrgANIzATIon/arcgis/rest/services/Middle_Little_Missouri_SubBasin_Wetlands_and_Riparian_Areas/FeatureServer/synchronizeReplica\n",
      "Middle_Little_Missouri_SubBasin_Wetlands_and_Riparian_Areas/FeatureServer - Job url :https://services7.arcgis.com/YoUrOrgANIzATIon/arcgis/rest/services/Middle_Little_Missouri_SubBasin_Wetlands_and_Riparian_Areas/FeatureServer/jobs/22fdb7d2-3165-4eb1-b8ec-5e825b7653e8\n",
      "Middle_Little_Missouri_SubBasin_Wetlands_and_Riparian_Areas/FeatureServer - Get Service Definition\n",
      "Middle_Little_Missouri_SubBasin_Wetlands_and_Riparian_Areas/FeatureServer - Submit sync job\n",
      "Middle_Little_Missouri_SubBasin_Wetlands_and_Riparian_Areas/FeatureServer - Submitting sync job:https://services7.arcgis.com/YoUrOrgANIzATIon/arcgis/rest/services/Middle_Little_Missouri_SubBasin_Wetlands_and_Riparian_Areas/FeatureServer/synchronizeReplica\n",
      "Middle_Little_Missouri_SubBasin_Wetlands_and_Riparian_Areas/FeatureServer - Job url :https://services7.arcgis.com/YoUrOrgANIzATIon/arcgis/rest/services/Middle_Little_Missouri_SubBasin_Wetlands_and_Riparian_Areas/FeatureServer/jobs/9b0d7ca8-6f79-4f98-afb3-0fcebc27e959\n",
      "World_Basemap_v2/VectorTileServer - Check if export URL is different from service URL.\n",
      "World_Basemap_v2/VectorTileServer - Submitting export vector tile job:https://basemaps.arcgis.com/arcgis/rest/services/World_Basemap_v2/VectorTileServer/exportTiles\n",
      "World_Basemap_v2/VectorTileServer - Job url:https://basemaps.arcgis.com/arcgis/rest/services/World_Basemap_v2/VectorTileServer/jobs/a92e57b7e1a22343\n",
      "Middle_Little_Missouri_SubBasin_Wetlands_and_Riparian_Areas/FeatureServer - Add/Update package item\n",
      "Middle_Little_Missouri_SubBasin_Wetlands_and_Riparian_Areas/FeatureServer - No changes for the package\n",
      "Middle_Little_Missouri_SubBasin_Wetlands_and_Riparian_Areas/FeatureServer - Add/Update package item\n",
      "Middle_Little_Missouri_SubBasin_Wetlands_and_Riparian_Areas/FeatureServer - No changes for the package\n",
      "Middle_Little_Missouri_SubBasin_Wetlands_and_Riparian_Areas/FeatureServer - Add/Update package item\n",
      "Middle_Little_Missouri_SubBasin_Wetlands_and_Riparian_Areas/FeatureServer - No changes for the package\n",
      "Middle_Little_Missouri_SubBasin_Wetlands_and_Riparian_Areas/FeatureServer - Processing complete\n",
      "World_Basemap_v2/VectorTileServer - Add/Update package item\n",
      "World_Basemap_v2/VectorTileServer - Vector tile package url:https://lws-job-results-prd0-use1.s3.amazonaws.com/export/b015ce0507e8ba7c.vtpk\n",
      "World_Basemap_v2/VectorTileServer - Updating package item by URL:b3566c44b5fe4304ab3853f1830ac1b1\n",
      "World_Basemap_v2/VectorTileServer - Checking status for package item:b3566c44b5fe4304ab3853f1830ac1b1\n",
      "Middle_Little_Missouri_SubBasin_Wetlands_and_Riparian_Areas/FeatureServer - Processing complete\n",
      "Middle_Little_Missouri_SubBasin_Wetlands_and_Riparian_Areas/FeatureServer - Processing complete\n",
      "World_Basemap_v2/VectorTileServer - Add/Update package item\n",
      "World_Basemap_v2/VectorTileServer - Vector tile package url:https://lws-job-results-prd0-use1.s3.amazonaws.com/export/a5ef2c47e476b160.vtpk\n",
      "World_Basemap_v2/VectorTileServer - Updating package item by URL:97710205e4ca4c88a3b8568fde6ae1da\n",
      "World_Basemap_v2/VectorTileServer - Checking status for package item:97710205e4ca4c88a3b8568fde6ae1da\n",
      "World_Basemap_v2/VectorTileServer - Add/Update package item\n",
      "World_Basemap_v2/VectorTileServer - Vector tile package url:https://lws-job-results-prd0-use1.s3.amazonaws.com/export/aa5576c7a46b2d0a.vtpk\n",
      "World_Basemap_v2/VectorTileServer - Updating package item by URL:db850e1e9e8347fa84f28ace9ac2ea8c\n",
      "World_Basemap_v2/VectorTileServer - Checking status for package item:db850e1e9e8347fa84f28ace9ac2ea8c\n",
      "World_Basemap_v2/VectorTileServer - Processing complete\n",
      "World_Basemap_v2/VectorTileServer - Processing complete\n",
      "World_Basemap_v2/VectorTileServer - Processing complete\n",
      "Succeeded at Monday, August 19, 2024 7:02:21 PM (Elapsed Time: 2 minutes 13 seconds)\n",
      "RefreshMapAreaPackage GP Job: j463ed64babed47a6932085d52ed74e32 finished successfully.\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "[{'source': 'https://services7.arcgis.com/YoUrOrgANIzATIon/arcgis/rest/services/Middle_Little_Missouri_SubBasin_Wetlands_and_Riparian_Areas/FeatureServer',\n",
       "  'itemId': '2cc02db5b65548549fcd829c968e4104',\n",
       "  'state': 'unchanged'},\n",
       " {'source': 'https://services7.arcgis.com/YoUrOrgANIzATIon/arcgis/rest/services/Middle_Little_Missouri_SubBasin_Wetlands_and_Riparian_Areas/FeatureServer',\n",
       "  'itemId': 'f137c8363e25434f8a982eb84aca02e3',\n",
       "  'state': 'unchanged'},\n",
       " {'source': 'https://services7.arcgis.com/YoUrOrgANIzATIon/arcgis/rest/services/Middle_Little_Missouri_SubBasin_Wetlands_and_Riparian_Areas/FeatureServer',\n",
       "  'itemId': '55ba8ad002a2462eb6411c91ba53dd91',\n",
       "  'state': 'unchanged'},\n",
       " {'source': 'https://basemaps.arcgis.com/arcgis/rest/services/World_Basemap_v2/VectorTileServer',\n",
       "  'itemId': 'b3566c44b5fe4304ab3853f1830ac1b1',\n",
       "  'state': 'updated'},\n",
       " {'source': 'https://basemaps.arcgis.com/arcgis/rest/services/World_Basemap_v2/VectorTileServer',\n",
       "  'itemId': '97710205e4ca4c88a3b8568fde6ae1da',\n",
       "  'state': 'updated'},\n",
       " {'source': 'https://basemaps.arcgis.com/arcgis/rest/services/World_Basemap_v2/VectorTileServer',\n",
       "  'itemId': 'db850e1e9e8347fa84f28ace9ac2ea8c',\n",
       "  'state': 'updated'}]"
      ]
     },
     "execution_count": 124,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# update all offline areas for the fire web map\n",
    "wm_obj.offline_areas.update()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Now any field users are all set with the latest packages for use in a disconnected setting."
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.11.0"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": true,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": true
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
